home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / xw2.000 / xw2 / xw / csource / x2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-03  |  81.7 KB  |  2,800 lines

  1.  
  2. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  3. /*                                                                           */
  4. /*                                                                           */
  5. /*   Modul X2.C                                                              */
  6. /*                                                                           */
  7. /*   XbWFOs - Oszilloskop-Routinen                                           */
  8. /*   XbWFTb - Toolbox-Routinen                                               */
  9. /*   XbWFBV - Objektverwaltung                                               */
  10. /*                                                                           */
  11. /*                                                                           */
  12. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  13.  
  14.  
  15. /* Header--------------------------------------------------------------------*/
  16.  
  17. #include "xbw.h"
  18.  
  19. /*  --------------------------Compiler-Modelle-------------------------------*/
  20.                       /* ***................Unabhängig         */
  21.                       /* ---................Nicht möglich      */
  22.                       /* !!!................Noch zu machen     */
  23.                       /* ???................unklar             */
  24.                       /* OSC................Wenn UseOsc def    */
  25.                       /*     PRJ............Fuer Projekteditor */
  26.                       /*     TC3............Turbo-C Version    */
  27.                       /*         GNU........32-Bit Version     */
  28.                       /*             X11....X-Window           */
  29.  
  30.  
  31. /*{{{  XbWFOb_GetPar(      ***      Parametersatz fur ein Obj. lesen*/
  32. char  *XbWFOb_GetPar(
  33.     XbWDDb_DbIWdw  *WI,
  34.     XbWDDb_DbIObj  *TO, char *sname, int mode){
  35.   XbWDDb_DbIPtr *ip;
  36.  
  37.   if (mode&XbWDOb_GtFrsO){
  38.     ip = (XbWDDb_DbIPtr*)WI->obj;
  39.     XbWVOb_GOPao = XbWFDb_CDbIToPtr(*ip,XbWDDb_DbISys);
  40.     XbWVOb_GOPao = (XbWDDb_DbIVar  *)XbWFDb_NextGrp(XbWVOb_GOPao,NULL);
  41.     }
  42.   else {
  43.     if (mode&XbWDOb_GtNxtO) {
  44.       XbWVOb_GOPao = (XbWDDb_DbIVar  *)XbWFDb_NextGrp(XbWVOb_GOPao,NULL);
  45.       }
  46.     else {
  47.       if (mode&XbWDOb_GetAnO) {
  48.         ip = (XbWDDb_DbIPtr*)WI->obj;
  49.         XbWVOb_GOPao = (XbWDDb_DbIVar  *)XbWFDb_NextGrp(XbWFDb_CDbIToPtr(*ip,XbWDDb_DbISys),
  50.           sname);
  51.         }
  52.       else {
  53.         if (mode&XbWDOb_GtLstO) {
  54.           XbWDDb_DbIVar  *GetObjPar_to = NULL;
  55.           ip = (XbWDDb_DbIPtr*)WI->obj;
  56.           XbWVOb_GOPao = XbWFDb_CDbIToPtr(*ip,XbWDDb_DbISys);
  57.           while ((XbWVOb_GOPao = (XbWDDb_DbIVar  *)
  58.               XbWFDb_NextGrp(XbWVOb_GOPao,NULL)) != NULL) {
  59.             char *f_nm;
  60.             XbWDDb_DbIVar  *TV = XbWVOb_GOPao;
  61.             if ((TV->tp & XbWDDb_Typ) == XbWDDb_Str) {
  62.               f_nm = (char*)&( ((XbWDDb_DbIStr *)TV)->nmi[TV->tp & XbWDDb_NLen]);
  63.               }
  64.             else {
  65.               f_nm = (char*)XbWFDb_GetInh(TV,XbWDDb_Str);
  66.               };
  67.             if (XbWFTb_CmpStr((char*)WI->nm,f_nm) == 0) {
  68.               GetObjPar_to = XbWVOb_GOPao;
  69.               }
  70.             else {
  71.               goto gt_OBJ_weiter;
  72.               };
  73.             };
  74.           gt_OBJ_weiter:;
  75.           if (GetObjPar_to == NULL) {
  76.             XbWVOb_GOPao = XbWFDb_CDbIToPtr(*ip,XbWDDb_DbISys);
  77.             }
  78.           else {
  79.             XbWVOb_GOPao = GetObjPar_to;
  80.             };
  81.           }
  82.         else {
  83.           if (mode&XbWDOb_GtAnfO) {
  84.             ip = (XbWDDb_DbIPtr*)WI->obj;
  85.             XbWVOb_GOPao = XbWFDb_CDbIToPtr(*ip,XbWDDb_DbISys);
  86.             };
  87.           };
  88.         };
  89.       };
  90.     };
  91.  
  92.   {
  93.     XbWDDb_DbIVar  *TV = NULL;
  94.  
  95.     if (mode&XbWDOb_GtMinP) {
  96.  
  97.       TV = XbWVOb_GOPao;
  98.       if (TV == NULL) { return(NULL); };
  99.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Str) {
  100.         TO->onm = (char*)&( ((XbWDDb_DbIStr *)TV)->nmi[TV->tp & XbWDDb_NLen]);
  101.         }
  102.       else {
  103.         TO->onm = (char*)XbWFDb_GetInh(TV,XbWDDb_Str);
  104.         };
  105.  
  106.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  107.  
  108.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_NPtr) {
  109.         TO->nxt = (XbWDDb_DbIPtr  *) &((XbWDDb_DbINPtr *)TV)->inh;
  110.         }
  111.       else {
  112.         TO->nxt = NULL;
  113.         };
  114.  
  115.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  116.  
  117.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Str) {
  118.         TO->wdw = (char*)&( ((XbWDDb_DbIStr *)TV)->nmi[TV->tp & XbWDDb_NLen]);
  119.         }
  120.       else {
  121.         TO->wdw = (char*)XbWFDb_GetInh(TV,XbWDDb_Str);
  122.         };
  123.  
  124.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  125.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  126.         TO->XA = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  127.         }
  128.       else {
  129.         TO->XA = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  130.         };
  131.  
  132.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  133.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  134.         TO->YA = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  135.         }
  136.       else {
  137.         TO->YA = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  138.         };
  139.  
  140.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  141.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  142.         TO->XB = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  143.         }
  144.       else {
  145.         TO->XB = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  146.         };
  147.  
  148.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  149.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  150.         TO->YB = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  151.         }
  152.       else {
  153.         TO->YB = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  154.         };
  155.  
  156.       XbWVOb_GOPlv = TV;
  157.       XbWVOb_GOPnm = (char *)TO->onm;
  158.  
  159.       };
  160.  
  161.     if (mode&(XbWDOb_GtDspP|XbWDOb_GtEdtP)) {
  162.       if (TV != NULL) {
  163.         XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  164.         }
  165.       else {
  166.         if ((char*)TO->onm == (char*)XbWVOb_GOPnm) {
  167.           TV = XbWVOb_GOPlv;
  168.           XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  169.           }
  170.         else {
  171.           return(NULL);
  172.           };
  173.         };
  174.  
  175.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  176.         TO->bkc = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  177.         }
  178.       else {
  179.         TO->bkc = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  180.         };
  181.  
  182.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  183.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  184.         TO->bfc = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  185.         }
  186.       else {
  187.         TO->bfc = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  188.         };
  189.  
  190.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  191.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  192.         TO->dfc = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  193.         }
  194.       else {
  195.         TO->dfc = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  196.         };
  197.  
  198.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  199.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  200.         TO->txc = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  201.         }
  202.       else {
  203.         TO->txc = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  204.         };
  205.  
  206.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  207.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Str) {
  208.         TO->odt = (char*)&( ((XbWDDb_DbIStr *)TV)->nmi[TV->tp & XbWDDb_NLen]);
  209.         }
  210.       else {
  211.         TO->odt = (char*)XbWFDb_GetInh(TV,XbWDDb_Str);
  212.         };
  213.  
  214.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  215.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  216.         TO->dst = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  217.         }
  218.       else {
  219.         TO->dst = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  220.         };
  221.  
  222.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  223.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  224.         TO->est = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  225.         }
  226.       else {
  227.         TO->est = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  228.         };
  229.  
  230.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  231.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Int) {
  232.         TO->dwd = (int *) &((XbWDDb_DbIInt *)TV)->inh;
  233.         }
  234.       else {
  235.         TO->dwd = (int *)XbWFDb_GetInh(TV,XbWDDb_Int);
  236.         };
  237.  
  238.       XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  239.       if ((TV->tp & XbWDDb_Typ) == XbWDDb_Str) {
  240.         TO->oet = (char*)&( ((XbWDDb_DbIStr *)TV)->nmi[TV->tp & XbWDDb_NLen]);
  241.         }
  242.       else {
  243.         TO->oet = (char*)XbWFDb_GetInh(TV,XbWDDb_Str);
  244.         };
  245.       TO->chn = TV;
  246.       };
  247.  
  248.     };
  249.   return(TO->onm);
  250.   };
  251. /*}}}  */
  252. /*{{{  XbWFOb_epO(         ***      Edit Previous Object: epO*/
  253. int  XbWFOb_epO(char *name){
  254.   int ii; char sstr[20]; char *mf_n;
  255.   XbWDDb_DbIVar  *grst;
  256.  
  257.   for (ii=0;ii<100;ii++){
  258.     sprintf(sstr,"epO%d",ii);
  259.     {
  260.       XbWDDb_DbIObj XbWVOb_O;
  261.       XbWDDb_DbIVar  *gs;
  262.  
  263.       if ((gs = XbWFDb_CDbIToPtr(*XbWVWd_W.obj,XbWDDb_DbISys)) == NULL) { return(1);};
  264.  
  265.       if ((grst = XbWFDb_NextGrp(gs,name)) != NULL) {
  266.         if ((mf_n = (char*)XbWFDb_VarInh(grst,XbWDDb_Str,sstr,1)) != NULL) {
  267.           XbWVOb_O.onm = NULL;
  268.           if (XbWFOb_GetPar(&XbWVWd_W,&XbWVOb_O,mf_n,XbWDOb_GtAllP|XbWDOb_GetAnO) != NULL){
  269.             XbWVEd_nxt = Vor;
  270.             XbWFOj_DiEdContents(&XbWVWd_W,&XbWVOb_O,1);
  271.             if (XbWVEd_nxt == CursorUp) {
  272.               XbWFOb_epO((char*)XbWVOb_O.onm);
  273.               };
  274.             XbWSMs_WButtUp();
  275.             };
  276.           };
  277.         }
  278.       else {
  279.         ii = 110;
  280.         };
  281.       };
  282.     };
  283.   return(0);
  284.   };
  285.  
  286. /*}}}  */
  287. /*{{{  XbWFOb_ebO(         ***      Edit Before Object: bW,rbK,ebO,wbX,rbT*/
  288. int  XbWFOb_ebO(XbWDDb_DbIObj  *MOB){
  289.   int ii; char sstr[29]; char *mf_n;
  290.   for (ii=0;ii<100;ii++){
  291.     sprintf(sstr,"bW%d",ii);
  292.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  293.       XbWFWd_SwitchTo(mf_n,16);
  294.       }
  295.     else {
  296.       ii = 110;
  297.       };
  298.     };
  299.   for (ii=0;ii<100;ii++){
  300.     sprintf(sstr,"rbK%d",ii);
  301.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  302.       XbWFMf_ReadMakro(mf_n);
  303.       }
  304.     else {
  305.       ii = 110;
  306.       };
  307.     };
  308.   if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_FPtr,"rbC",0)) != NULL) {
  309.     XbWFMf_RdCompMak(XbWVDb_ActGrp2);
  310.     };
  311.   for (ii=0;ii<100;ii++){
  312.     sprintf(sstr,"ebO%d",ii);
  313.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  314.       XbWFOb_EdDpObj(mf_n,4);
  315.       }
  316.     else {
  317.       ii = 110;
  318.       };
  319.     };
  320.   for (ii=0;ii<100;ii++){
  321.     sprintf(sstr,"wbX%d",ii);
  322.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  323.       XbWFMx_RWGrp(mf_n,"WRITE",0,0,NULL);
  324.       }
  325.     else {
  326.       ii = 110;
  327.       };
  328.     };
  329.  
  330.   for (ii=0;ii<100;ii++){
  331.     sprintf(sstr,"rbT%d",ii);
  332.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  333.       XbWFMf_ReadMF(mf_n);
  334.       }
  335.     else {
  336.       ii = 110;
  337.       };
  338.     };
  339.  
  340.   return(0);
  341.   };
  342.  
  343. /*}}}  */
  344. /*{{{  XbWFOb_Edit(        ***      Edit: raK,raT,raX,aW des Obj.*/
  345. int  XbWFOb_Edit(XbWDDb_DbIObj  *MOB){
  346.   int ii; char sstr[20]; char *mf_n;
  347.   for (ii=0;ii<100;ii++){
  348.     sprintf(sstr,"raX%d",ii);
  349.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  350.       XbWFMx_RWGrp(mf_n,"READ",0,0,NULL);
  351.       }
  352.     else {
  353.       ii = 110;
  354.       };
  355.     };
  356.   for (ii=0;ii<100;ii++){
  357.     sprintf(sstr,"raT%d",ii);
  358.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  359.       XbWFMf_ReadMF(mf_n);
  360.       }
  361.     else {
  362.       ii = 110;
  363.       };
  364.     };
  365.   for (ii=0;ii<100;ii++){
  366.     sprintf(sstr,"aW%d",ii);
  367.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  368.       XbWFWd_SwitchTo(mf_n,16);
  369.       }
  370.     else {
  371.       ii = 110;
  372.       };
  373.     };
  374.   for (ii=0;ii<100;ii++){
  375.     sprintf(sstr,"oW%d",ii);
  376.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  377.       XbWFWd_SwitchTo(mf_n,48);
  378.       }
  379.     else {
  380.       ii = 110;
  381.       };
  382.     };
  383.   for (ii=0;ii<100;ii++){
  384.     sprintf(sstr,"raK%d",ii);
  385.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  386.       XbWFMf_ReadMakro(mf_n);
  387.       }
  388.     else {
  389.       ii = 110;
  390.       };
  391.     };
  392.   if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_FPtr,"raC",0)) != NULL) {
  393.     XbWFMf_RdCompMak(XbWVDb_ActGrp2);
  394.     };
  395.   for (ii=0;ii<100;ii++){
  396.     sprintf(sstr,"dpO%d",ii);
  397.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  398.       XbWFOb_EdDpObj(mf_n,0);
  399.       }
  400.     else {
  401.       ii = 110;
  402.       };
  403.     };
  404.   return(0);
  405.   };
  406. /*}}}  */
  407. /*{{{  XbWFOb_eqO(         ***      Edit Queue: rqX,rqT,eqO,dqO des Objektes*/
  408. int  XbWFOb_eqO(XbWDDb_DbIObj  *MOB){
  409.   int ii; char sstr[20]; char *mf_n;
  410.   for (ii=0;ii<100;ii++){
  411.     sprintf(sstr,"rqX%d",ii);
  412.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  413.       XbWFMx_RWGrp(mf_n,"READ",0,0,NULL);
  414.       }
  415.     else {
  416.       ii = 110;
  417.       };
  418.     };
  419.   for (ii=0;ii<100;ii++){
  420.     sprintf(sstr,"rqT%d",ii);
  421.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  422.       XbWFMf_ReadMF(mf_n);
  423.       }
  424.     else {
  425.       ii = 110;
  426.       };
  427.     };
  428.   for (ii=0;ii<100;ii++){
  429.     sprintf(sstr,"qW%d",ii);
  430.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  431.       XbWFWd_SwitchTo(mf_n,16);
  432.       }
  433.     else {
  434.       ii = 110;
  435.       };
  436.     };
  437.   for (ii=0;ii<100;ii++){
  438.     sprintf(sstr,"rqK%d",ii);
  439.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  440.       XbWFMf_ReadMakro(mf_n);
  441.       }
  442.     else {
  443.       ii = 110;
  444.       };
  445.     };
  446.   if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_FPtr,"rqC",0)) != NULL) {
  447.     XbWFMf_RdCompMak(XbWVDb_ActGrp2);
  448.     };
  449.   if (XbWVEd_nxt != CursorUp) {
  450.     for (ii=0;ii<100;ii++){
  451.       if (XbWVEd_nxt != EndInput) {
  452.         sprintf(sstr,"eqO%d",ii);
  453.         if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  454.           XbWVEd_nxt = Vor;
  455.           XbWFOb_EdDpObj(mf_n,1);
  456.           if (XbWVEd_nxt == CursorUp) {
  457.             XbWFOb_epO(mf_n);
  458.             };
  459.           if (XbWVEd_nxt == EndInput) {
  460.             ii = 110;
  461.             };
  462.           }
  463.         else {
  464.           ii = 110;
  465.           };
  466.         };
  467.       };
  468.     };
  469.   for (ii=0;ii<100;ii++){
  470.     sprintf(sstr,"dqO%d",ii);
  471.     if ((mf_n = (char*)XbWFDb_VarInh(MOB->chn,XbWDDb_Str,sstr,1)) != NULL) {
  472.       XbWFOb_EdDpObj(mf_n,0);
  473.       }
  474.     else {
  475.       ii = 110;
  476.       };
  477.     };
  478.   return(0);
  479.   };
  480. /*}}}  */
  481. /*{{{  XbWFOb_dpO(         ***      dpO ausfuhren fur ein Objekt*/
  482. void  XbWFOb_dpO(
  483.     XbWDDb_DbIWdw  *WI, XbWDDb_DbIObj  *NotDispObj){
  484.   int win_found;
  485.   int sr_mod = XbWDOb_GtMinP | XbWDOb_GtFrsO;
  486.   int cursormrk = XbWVMs_CSet;
  487.  
  488.   XbWDDb_DbIObj MOB; char *obj_name; MOB.onm = NULL;
  489.  
  490.   XbWFGr_CurOFF();
  491.   obj_name = NULL;
  492.  
  493.   win_found=0;
  494.   while ((obj_name = (char*)XbWFOb_GetPar(
  495.          &XbWVWd_W,
  496.          &MOB,obj_name,sr_mod)) != NULL){
  497.     sr_mod = XbWDOb_GtMinP | XbWDOb_GtNxtO;
  498.     if (MOB.onm != NULL) {
  499.       if (NotDispObj != NULL) {
  500.         if (XbWFTb_CmpStr((char*)NotDispObj->onm,(char*)MOB.onm) == 0) {
  501.           goto weiter;
  502.           };
  503.         };
  504.       if (XbWFTb_CmpStr((char*)WI->nm,(char*)MOB.wdw) != 0) {
  505.         if (win_found){
  506.           goto ende_dpalleobj;
  507.           };
  508.         }
  509.       else {
  510.         win_found = 1;
  511.         if (XbWFTb_CmpBox(*MOB.XA,*MOB.YA,*MOB.XB,*MOB.YB,  0,0,
  512.             *WI->sx,  *WI->sy) != 0){
  513.           XbWFOb_GetPar(WI,&MOB,(char*)MOB.onm,XbWDOb_GtDspP);
  514.           XbWFOj_DiEdContents(WI,&MOB,0);
  515.           };
  516.         };
  517.       weiter:;
  518.       };
  519.     };
  520.  
  521.   ende_dpalleobj:
  522.   if (cursormrk){
  523.     XbWFGr_CurON();
  524.     };
  525.  
  526.   };
  527.  
  528. /*}}}  */
  529. /*{{{  XbWFOj_EdCalc(      ***      Edit CALC: Ausfuehren einer Berechnung*/
  530. int  XbWFOj_EdCalc(int edit, XbWDDb_DbIObj  *TO){
  531.   XbWDDb_DbIVar  *TV;
  532.   char *sstr; int display; double value;
  533.   int reg;
  534.   double regs[10];
  535.  
  536.   if (edit == 3){ return(0); };
  537.   display = XbWFDb_GetNum(TO->chn,"#D",1);
  538.   value = XbWFDb_GetNum(TO->chn,"V",1);
  539.   TV = (XbWDDb_DbIVar  *)TO->chn;
  540.   while(1){
  541.     if(((TV->tp)&XbWDDb_Typ) == XbWDDb_GPtr){
  542.       XbWFDb_PutNum(TO->chn,"V",1,value);
  543.       if (display){
  544.         XbWFOj_GetNum(TO);
  545.         XbWSGr_RBBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,XbWVOb_GTxt,*TO->bkc,*TO->txc,*TO->bfc);
  546.         };
  547.       return(0);
  548.       };
  549.     sstr = (char*)XbWFDb_GetNam((XbWDDb_DbIVar  *)TV);
  550.     if (sstr[0] == '#'){
  551.       switch(sstr[1]){
  552.         case 'R':
  553.           switch(sstr[2]){
  554.             case 'M':
  555.               reg = sstr[3] - '0';
  556.               XbWFDb_PutNum(TV,NULL,1,regs[reg]);
  557.               break;
  558.             case '0':
  559.             case '1':
  560.             case '2':
  561.             case '3':
  562.             case '4':
  563.             case '5':
  564.             case '6':
  565.             case '7':
  566.             case '8':
  567.             case '9':
  568.             switch(sstr[3]){
  569.               case '*':
  570.                 reg = sstr[2] - '0';
  571.                 regs[reg] = (double)regs[reg] * (double) XbWFDb_GetNum(TV,NULL,1);
  572.                 break;
  573.               case '=':
  574.                 reg = sstr[2] - '0';
  575.                 regs[reg] = XbWFDb_GetNum(TV,NULL,1);
  576.                 break;
  577.               case '+':
  578.                 reg = sstr[2] - '0';
  579.                 regs[reg] = (double)regs[reg] + (double) XbWFDb_GetNum(TV,NULL,1);
  580.                 break;
  581.               case '-':
  582.                 reg = sstr[2] - '0';
  583.                 regs[reg] = (double)regs[reg] - (double) XbWFDb_GetNum(TV,NULL,1);
  584.                 break;
  585.               case '/':
  586.                 reg = sstr[2] - '0';
  587.                 if (regs[reg] != 0){
  588.                   regs[reg] = (double)regs[reg] / (double) XbWFDb_GetNum(TV,NULL,1);
  589.                   };
  590.                 break;
  591.               case 'C':
  592.                 reg = sstr[2] - '0';
  593.                 regs[reg] = 0;
  594.                 break;
  595.               };
  596.               break;
  597.             case '=': regs[(int)XbWFDb_GetNum(TV,NULL,1)]  = value; break;
  598.             case '-': regs[(int)XbWFDb_GetNum(TV,NULL,1)] = (double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] - (double) value; break;
  599.             case '+': regs[(int)XbWFDb_GetNum(TV,NULL,1)] = (double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] + (double) value; break;
  600.             case '*': regs[(int)XbWFDb_GetNum(TV,NULL,1)] = (double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] * (double) value; break;
  601.             case '/':
  602.               if (value != 0){
  603.                 regs[(int)XbWFDb_GetNum(TV,NULL,1)] =(double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] / (double) value;
  604.                 };
  605.               break;
  606.             };
  607.           break;
  608.         case 'r':
  609.           switch(sstr[2]){
  610.             case '0':
  611.             case '1':
  612.             case '2':
  613.             case '3':
  614.             case '4':
  615.             case '5':
  616.             case '6':
  617.             case '7':
  618.             case '8':
  619.             case '9':
  620.             switch(sstr[3]){
  621.               case '=':
  622.                 reg = sstr[2] - '0';
  623.                 regs[reg] = regs[(int)XbWFDb_GetNum(TV,NULL,1)];
  624.                 break;
  625.               case '+':
  626.                 reg = sstr[2] - '0';
  627.                 regs[reg] =(double)regs[reg] + (double)  regs[(int)XbWFDb_GetNum(TV,NULL,1)];
  628.                 break;
  629.               case '-':
  630.                 reg = sstr[2] - '0';
  631.                 regs[reg] =(double)regs[reg] - (double)  regs[(int)XbWFDb_GetNum(TV,NULL,1)];
  632.                 break;
  633.               case '*':
  634.                 reg = sstr[2] - '0';
  635.                 regs[reg] =(double)regs[reg] * (double)  regs[(int)XbWFDb_GetNum(TV,NULL,1)];
  636.                 break;
  637.               case '/':
  638.                 reg = sstr[2] - '0';
  639.                 if (XbWFDb_GetNum(TV,NULL,1) != 0){
  640.                   regs[reg] =(double)regs[reg] / (double)  regs[(int)XbWFDb_GetNum(TV,NULL,1)];
  641.                   };
  642.                 break;
  643.               case 'C':
  644.                 reg = sstr[2] - '0';
  645.                 regs[reg] = 0;
  646.                 break;
  647.               };
  648.               break;
  649.             case '=': regs[(int)XbWFDb_GetNum(TV,NULL,1)]  = value; break;
  650.             case '-': regs[(int)XbWFDb_GetNum(TV,NULL,1)]  =(double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] - (double)  value; break;
  651.             case '+': regs[(int)XbWFDb_GetNum(TV,NULL,1)]  =(double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] + (double)  value; break;
  652.             case '*': regs[(int)XbWFDb_GetNum(TV,NULL,1)]  =(double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] * (double)  value; break;
  653.             case '/':
  654.               if (value != 0){
  655.                 regs[(int)XbWFDb_GetNum(TV,NULL,1)] = (double)regs[(int)XbWFDb_GetNum(TV,NULL,1)] / (double)  value;
  656.                 };
  657.               break;
  658.             };
  659.           break;
  660.         case '+':
  661.           if (sstr[2] == 'R'){
  662.             reg = XbWFDb_GetNum(TV,NULL,1);
  663.             value = (double)value + (double) regs[reg]; }
  664.           else { value += XbWFDb_GetNum(TV,NULL,1); };
  665.           break;
  666.         case '=':
  667.           if (sstr[2] == 'R'){
  668.             reg = XbWFDb_GetNum(TV,NULL,1);
  669.             value = regs[reg]; }
  670.           else { value  = XbWFDb_GetNum(TV,NULL,1); };
  671.           break;
  672.         case '-':
  673.           if (sstr[2] == 'R'){
  674.             reg = XbWFDb_GetNum(TV,NULL,1);
  675.             value =(double)value - (double) regs[reg]; }
  676.           else { value =(double)value - (double) XbWFDb_GetNum(TV,NULL,1); };
  677.           break;
  678.         case '*':
  679.           if (sstr[2] == 'R'){
  680.             reg = XbWFDb_GetNum(TV,NULL,1);
  681.             value =(double)value * (double) regs[reg]; }
  682.           else { value =(double)value * (double) XbWFDb_GetNum(TV,NULL,1); };
  683.           break;
  684.         case '/':
  685.           if (sstr[2] == 'R'){
  686.             reg = XbWFDb_GetNum(TV,NULL,1);
  687.             if (regs[reg] != 0){
  688.               value =(double)value / (double) regs[reg];
  689.               };
  690.             }
  691.           else {
  692.             if (XbWFDb_GetNum(TV,NULL,1) != 0){
  693.               value =(double)value / (double) XbWFDb_GetNum(TV,NULL,1);
  694.               };
  695.             };
  696.           break;
  697.         };
  698.       };
  699.     XbWFDb_ForWd(&TV,XbWDDb_DbISys);
  700.     };
  701.   };
  702. /*}}}  */
  703. /*{{{  XbWFOb_EdObjMausPos(***      Edit fur ein angeklicktes Objekt*/
  704. void  XbWFOb_EdObjMausPos(
  705.     XbWDDb_DbIWdw  *WI, int mausxa, int mausya){
  706.   int mxa,mya;
  707.   XbWDDb_DbIObj MOB;
  708.   int aToEdit,vToEdit,win_found;
  709.   char *obj_name;char afname[32],vfname[32];
  710.   int sr_mod = XbWDOb_GtMinP | XbWDOb_GtFrsO;
  711.  
  712.   mxa = mausxa- *WI->nx; mya = mausya- *WI->ny -1;
  713.   MOB.onm = NULL;
  714.  
  715.   aToEdit = vToEdit = 0;
  716.  
  717.   win_found = 0;
  718.   obj_name = NULL;
  719.   while ((obj_name = (char*)XbWFOb_GetPar(
  720.       &XbWVWd_W,&MOB,obj_name,sr_mod)) != NULL){
  721.     sr_mod = XbWDOb_GtMinP | XbWDOb_GtNxtO;
  722.     if (MOB.wdw != NULL) {
  723.       if (XbWFTb_CmpStr((char*)WI->nm,(char*)MOB.wdw) != 0) {
  724.         if (win_found){goto weiter;};
  725.         }
  726.       else {
  727.         win_found = 1;
  728.         if ( (mxa>= *MOB.XA)&(mya>= *MOB.YA)&(mxa<= *MOB.XB)&(mya<= *MOB.YB)){
  729.           strcpy(afname,(char*)MOB.onm);
  730.           aToEdit = 1;
  731.         };};
  732.       };
  733.     };
  734.   weiter:;
  735.  
  736.   if (!(aToEdit+vToEdit)){
  737.     if (XbWVWd_RedrawON) {
  738.       XbWFWd_Draw();
  739.       XbWFWd_Rebuild();
  740.       };
  741.     XbWFGr_CurOFF();
  742.     return;
  743.     };
  744.  
  745.   obj_name = NULL;
  746.   if (aToEdit){
  747.     strcpy(vfname,afname);
  748.     };
  749.   if ((obj_name = (char*)XbWFOb_GetPar(
  750.       WI,&MOB,vfname,XbWDOb_GtAllP|XbWDOb_GetAnO)) != NULL){
  751.     XbWVOb_ox = mxa;
  752.     XbWVOb_oy = mya;
  753.     XbWVOb_EdLvl++;
  754.     XbWFGr_CurOFF();
  755.     XbWFOj_DiEdContents(WI,&MOB,3);
  756.     XbWFOb_ebO(&MOB);
  757.     XbWFOb_GetPar(WI,&MOB,vfname,XbWDOb_GtAllP|XbWDOb_GetAnO);
  758.     XbWVEd_nxt = Vor;
  759.     XbWFOj_DiEdContents(WI,&MOB,1);
  760.     if (XbWVEd_nxt == CursorUp) {
  761.       XbWFOb_epO((char*)MOB.onm);
  762.       };
  763.  
  764.     {
  765.       int ii;
  766.       char *obn;
  767.       char sstr[100];
  768.       for (ii=0;ii<100;ii++){
  769.         sprintf(sstr,"edO%d",ii);
  770.         if ((obn = (char*)XbWFDb_VarInh(MOB.chn,XbWDDb_Str,sstr,1)) != NULL) {
  771.           XbWVEd_nxt = Vor;
  772.           XbWFOb_EdDpObj(obn,1);
  773.           if (XbWVEd_nxt == CursorUp) {
  774.             XbWFOb_epO(obn);
  775.             };
  776.           if (XbWVEd_nxt != Vor) {
  777.             ii = 110;
  778.             };
  779.           }
  780.         else {
  781.           ii= 110;
  782.           };
  783.         };
  784.       }
  785.  
  786.  
  787.     XbWFOb_Edit(&MOB);
  788.  
  789.     XbWVOb_EdLvl--;
  790.     if (!XbWVOb_EdLvl){
  791.       XbWFOb_eqO(&MOB);
  792.       };
  793.  
  794.     if (*MOB.dwd){
  795.       if (XbWFTb_CmpStr((char*)XbWVWd_W.nm,(char*)MOB.onm) != 0){
  796.         XbWFWd_Draw();
  797.         };
  798.       XbWFWd_Rebuild();
  799.       };
  800.     };
  801.   };
  802.  
  803.  
  804. /*}}}  */
  805. /*{{{  XbWFOb_EditAndDisp( ***      Editier-Hauptroutine*/
  806. int  XbWFOb_EditAndDisp(char *obn,int mode){
  807.   XbWDDb_DbIObj MOB;
  808.   MOB.onm = NULL;
  809.   if (XbWFOb_GetPar(&XbWVWd_W,&MOB,obn,XbWDOb_GtAllP|XbWDOb_GetAnO) != NULL){
  810.     XbWFWd_SwitchTo((char*)MOB.wdw,0x10);
  811.     if (mode != 4){
  812.       if (mode){
  813.         XbWVOb_EdLvl++;
  814.         XbWFGr_CurOFF();
  815.         XbWFOj_DiEdContents(&XbWVWd_W,&MOB,3);
  816.         XbWFOb_ebO(&MOB);
  817.         XbWFOb_GetPar(&XbWVWd_W,&MOB,(char*)MOB.onm,XbWDOb_GtAllP|XbWDOb_GetAnO);
  818.         XbWVEd_nxt = Vor;
  819.         XbWFOj_DiEdContents(&XbWVWd_W,&MOB,1);
  820.         if (XbWVEd_nxt == CursorUp) {
  821.           XbWFOb_epO((char*)MOB.onm);
  822.           };
  823.         XbWFOb_Edit(&MOB);
  824.  
  825.         {
  826.           int ii;
  827.           char *obn;
  828.           char sstr[100];
  829.           for (ii=0;ii<100;ii++){
  830.             sprintf(sstr,"edO%d",ii);
  831.             if ((obn = (char*)XbWFDb_VarInh(MOB.chn,XbWDDb_Str,sstr,1)) != NULL) {
  832.               XbWVEd_nxt = Vor;
  833.               XbWFOb_EdDpObj(obn,1);
  834.               if (XbWVEd_nxt == CursorUp) {
  835.                 XbWFOb_epO(obn);
  836.                 };
  837.               if (XbWVEd_nxt != Vor) {
  838.                 ii = 110;
  839.                 };
  840.               }
  841.             else {
  842.               ii= 110;
  843.               };
  844.             };
  845.           }
  846.  
  847.         XbWVOb_EdLvl--;
  848.         if (!XbWVOb_EdLvl){
  849.           XbWFOb_eqO(&MOB);
  850.           };
  851.  
  852.         if (*MOB.dwd){
  853.           if (XbWFTb_CmpStr((char*)XbWVWd_W.nm,(char*)MOB.onm) != 0){
  854.             XbWFWd_Draw();
  855.             };
  856.           XbWFWd_Rebuild();
  857.           };
  858.         };
  859.       };
  860.     return(0);
  861.     };
  862.   return(1);
  863.   };
  864.  
  865. /*}}}  */
  866. /*{{{  XbWFOb_EditOnly(    ***      Aufruf EditAndDisp als Edit*/
  867. int  XbWFOb_EditOnly(void  *(*p)[]){
  868.   if ((int)(*p)[0] != 1){return(1);};
  869.   return(XbWFOb_EditAndDisp((char*)(*p)[1],1));
  870.   };
  871. /*}}}  */
  872. /*{{{  XbWFOb_DispOnly(    ***      Aufruf EditAndDisp als Disp*/
  873. int  XbWFOb_DispOnly(void  *(*p)[]){
  874.   if ((int)(*p)[0] != 1){return(1);};
  875.   return(XbWFOb_EdDpObj((char*)(*p)[1],0));
  876.   };
  877. /*}}}  */
  878. /*{{{  XbWFOb_MovToPos(    ***      Objektmove mit mittl. Maustaste*/
  879. void  XbWFOb_MovToPos(
  880.     XbWDDb_DbIWdw  *WI, int mausxa, int mausya){
  881.   int mxa,mya;
  882.   XbWDDb_DbIObj MOB;
  883.   int aToEdit,vToEdit,win_found,select_xbw_setup = 0;
  884.   char *obj_name;char afname[32],vfname[32];
  885.   int sr_mod = XbWDOb_GtMinP | XbWDOb_GtFrsO;
  886.  
  887.   mxa = mausxa- *WI->nx; mya = mausya- *WI->ny;
  888.   MOB.onm = NULL;
  889.  
  890.   aToEdit = vToEdit = 0;
  891.  
  892.   win_found = 0;
  893.   obj_name = NULL;
  894.   while ((obj_name = (char*)XbWFOb_GetPar(
  895.       &XbWVWd_W,&MOB,obj_name,sr_mod)) != NULL){
  896.     sr_mod = XbWDOb_GtMinP | XbWDOb_GtNxtO;
  897.     if (MOB.wdw != NULL) {
  898.       if (XbWFTb_CmpStr((char*)WI->nm,(char*)MOB.wdw) != 0) {
  899.         if (win_found){goto weiter;};
  900.         }
  901.       else {
  902.         win_found = 1;
  903.         XbWVOb_X = *MOB.XA;  XbWVOb_Y = *MOB.YA;
  904.         XbWVOb_x = *MOB.XB;  XbWVOb_y = *MOB.YB;
  905.         if ( (mxa>= *MOB.XA)&(mya>= *MOB.YA)&(mxa<= *MOB.XB)&(mya<= *MOB.YB)){
  906.           strcpy(afname,(char*)MOB.onm);
  907.           aToEdit = 1;
  908.         };};
  909.       };
  910.     };
  911.   weiter:;
  912.  
  913.   if (!(aToEdit+vToEdit)){ XbWFGr_CurOFF(); return;};
  914.  
  915.   obj_name = NULL;
  916.   if (aToEdit){
  917.     strcpy(vfname,afname);
  918.     };
  919.   if ((obj_name = (char*)XbWFOb_GetPar(
  920.       WI,&MOB,vfname,XbWDOb_GtAllP|XbWDOb_GetAnO)) != NULL){
  921.  
  922.  
  923.     XbWVOb_ox = mxa;
  924.     XbWVOb_oy = mya;
  925.     XbWVOb_EdLvl++;
  926.  
  927.     XbWSMs_WButtUp();
  928.  
  929.     XbWFGr_CurOFF();
  930.  
  931.     {
  932.       int xa,ya;
  933.       int oxa,oya;
  934.  
  935.       XbWVOb_X = *MOB.XA;  XbWVOb_Y = *MOB.YA;
  936.       XbWVOb_x = *MOB.XB;  XbWVOb_y = *MOB.YB;
  937.       mxa = XbWVMs_XPos; mya = XbWVMs_YPos;
  938.  
  939.       oxa = mxa; oya = mya;
  940.  
  941.       xa = oxa - (mxa - XbWVMs_XPos)/2;
  942.       ya = oya - (mya - XbWVMs_YPos)/2;
  943.       XbWSMs_Warp(xa,ya);
  944.  
  945.       XbWSMs_DFramON(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,14);
  946.  
  947.       XbWSMs_Stat();
  948.       XbWSMs_ChkMot();
  949.  
  950.    /*   while ( XbWVMs_Button == 0) {
  951.         XbWSMs_Stat();
  952.         XbWSMs_ChkMot();
  953.         };
  954.    */
  955.       {
  956.         XbWDDb_DbIVar  *gr_st;
  957.  
  958.         gr_st = XbWFDb_FindGrp("OBX","act");
  959.         if (gr_st != NULL) {
  960.           XbWFDb_PutStr(gr_st,"aln",1,"OBJ");
  961.           XbWFDb_PutStr(gr_st,"agn",1,(char*)MOB.onm);
  962.           XbWFDb_PutStr(gr_st,"awn",1,(char*)MOB.wdw);
  963.           XbWFDb_PutNum(gr_st,"anr",1,0);
  964.           };
  965.         };
  966.  
  967.  select_xbw_setup=1;
  968.  goto move_ende; /* Abkⁿfi HHM MΣrz 94*/
  969.  
  970.  
  971.       while ( XbWVMs_Button == 1) {
  972.         if (XbWVMs_LButt == 0) {
  973.           select_xbw_setup = 1;
  974.           goto move_ende;
  975.           };
  976.         XbWSMs_Stat();
  977.         XbWSMs_ChkMot();
  978.         while (XbWVMs_Bewegt==0) {
  979.           XbWSMs_Stat();
  980.           XbWSMs_ChkMot();
  981.           if (XbWVMs_Button == 0) { goto move_ende;};
  982.           };
  983.         XbWSMs_FramOFF(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y);
  984.         xa = oxa - (mxa - XbWVMs_XPos)/2;
  985.         ya = oya - (mya - XbWVMs_YPos)/2;
  986.         XbWSMs_Warp(xa,ya);
  987.         XbWVOb_X += xa - oxa;  XbWVOb_x += xa - oxa;
  988.         XbWVOb_Y += ya - oya;  XbWVOb_y += ya - oya;
  989.         mxa = oxa = xa; mya = oya = ya;
  990.         XbWSMs_DFramON(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,14);
  991.         };
  992.       };
  993.  
  994.     move_ende:;
  995.     XbWSMs_FramOFF(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y);
  996.  
  997.     *MOB.XA = XbWVOb_X;  *MOB.YA = XbWVOb_Y;
  998.     *MOB.XB = XbWVOb_x;  *MOB.YB = XbWVOb_y;
  999.  
  1000.     XbWFWd_Draw();
  1001.     XbWFWd_Rebuild();
  1002.     if (select_xbw_setup) {
  1003.       XbWFWd_SwitchTo("XXWS",0);
  1004.       XbWFWd_Draw();
  1005.       XbWFWd_Rebuild();
  1006.       };
  1007.  
  1008.     XbWSMs_WButtUp();
  1009.     };
  1010.   };
  1011.  
  1012. /*}}}  */
  1013. /*{{{  XbWFOb_MovToWdw(    ***      Obj. in and. Wdw verlegen; Listen-update*/
  1014. int  XbWFOb_MovToWdw( void  *(*p)[],int (*t)[]) {
  1015.   char *onm, *wnm;
  1016.   if ( (int)(*p)[0] < 2) {
  1017.     return(1);
  1018.     };
  1019.   switch ( (int)(*t)[1]) {
  1020.     case XbWDMf_StrPar: onm = (char*)(*p)[1]; break;
  1021.     case XbWDMf_VLPar:  {
  1022.                           XbWDDb_DbIVar  *QQ;
  1023.                           QQ = (XbWDDb_DbIVar  *)(*p)[1];
  1024.                           if (QQ == NULL) { return(1); };
  1025.                           onm = (char*)XbWFDb_VarInh(QQ,XbWDDb_Str,NULL,1);
  1026.                           break;
  1027.                           };
  1028.     default: return(1);;
  1029.     };
  1030.   switch ( (int)(*t)[2]) {
  1031.     case XbWDMf_StrPar: wnm = (char*)(*p)[2]; break;
  1032.     case XbWDMf_VLPar:  {
  1033.                           XbWDDb_DbIVar  *QQ;
  1034.                           QQ = (XbWDDb_DbIVar  *)(*p)[2];
  1035.                           if (QQ == NULL) { return(2); };
  1036.                           wnm = (char*)XbWFDb_VarInh(QQ,XbWDDb_Str,NULL,1);
  1037.                           break;
  1038.                           };
  1039.     default: return(1);;
  1040.     };
  1041.   if (XbWFOb_SubMovWdw( onm, wnm)) {
  1042.     XbWFTb_HBeep();
  1043.     XbWFTb_HBeep();
  1044.     };
  1045.   return(0);
  1046.   };
  1047. /*}}}  */
  1048. /*{{{  XbWFOb_SubMovWdw(   ***      Unterroutine dazu*/
  1049. int  XbWFOb_SubMovWdw( char *onm, char *wnm){
  1050.     XbWDDb_DbIObj VOB,MOB,NOB;
  1051.     char *obj_name, *oldname, *wname;
  1052.     int sr_mod = XbWDOb_GtMinP|XbWDOb_GtFrsO;
  1053.     VOB.onm = NULL;
  1054.     MOB.onm = NULL;
  1055.     obj_name = NULL;
  1056.     oldname = NULL;
  1057.   while ((obj_name = (char*)XbWFOb_GetPar(
  1058.       &XbWVWd_W,&MOB,obj_name,sr_mod)) != NULL){
  1059.     sr_mod = XbWDOb_GtMinP | XbWDOb_GtNxtO;
  1060.     if (MOB.wdw != NULL) {
  1061.       if (XbWFTb_CmpStr((char*)XbWVWd_W.nm,(char*)MOB.wdw) != 0) {
  1062.         goto weiter_motw;
  1063.         };
  1064.  
  1065.       if (XbWFTb_CmpStr((char*)onm,(char*)MOB.onm) == 0) {
  1066.         if (oldname == NULL) {
  1067.           XbWFOb_GetPar(&XbWVWd_W,&VOB,NULL,XbWDOb_GtMinP|XbWDOb_GtAnfO);
  1068.           }
  1069.         else {
  1070.           XbWFOb_GetPar(&XbWVWd_W,&VOB,oldname,XbWDOb_GtMinP|XbWDOb_GetAnO);
  1071.           };
  1072.         goto weiter_motw;
  1073.         };
  1074.       };
  1075.     oldname = obj_name;
  1076.     };
  1077.  
  1078.   weiter_motw:;
  1079.   if (MOB.onm == NULL) { return(1); };
  1080.   if (VOB.onm == NULL) { return(1); };
  1081.   wname = (char*)XbWVWd_W.nm;
  1082.   XbWFWd_SwitchTo(wnm,0);
  1083.   sr_mod = XbWDOb_GtMinP|XbWDOb_GtLstO;
  1084.   if (XbWFOb_GetPar(&XbWVWd_W,&NOB,NULL,sr_mod) != NULL){
  1085.     XbWDDb_DbIPtr iV,iN,iM;
  1086.  
  1087.     iV = *VOB.nxt;
  1088.     iN = *NOB.nxt;
  1089.     iM = *MOB.nxt;
  1090.  
  1091.     *NOB.nxt = iV;        /* Objekt an die neue Queue anhaengen */
  1092.     *MOB.nxt = iN;
  1093.  
  1094.     *VOB.nxt = iM;        /* Objekt aus der alten Queue nehmen */
  1095.  
  1096.     {
  1097.       char *ms;
  1098.       int vtp;
  1099.       int SL;
  1100.       XbWDDb_DbIVar  *T_OB;
  1101.  
  1102.       T_OB = (XbWDDb_DbIVar  *)XbWFDb_FindGrp("OBJ",(char*)MOB.onm);
  1103.       XbWFDb_GetInf(T_OB, -1, "W", &vtp, &ms, &SL, 0);
  1104.       switch (vtp) {
  1105.         case XbWDDb_NPtr: {
  1106.             XbWDDb_DbINPtr  *TSRC;
  1107.             if ((TSRC = (XbWDDb_DbINPtr  *)
  1108.                 XbWFDb_FindGrp("WDW",(char*)XbWVWd_W.nm) ) == NULL) {
  1109.               return(1);
  1110.               };
  1111.             *((XbWDDb_DbIPtr*)ms) = XbWDDb_C_PtrToDbI(TSRC,XbWDDb_DbISys);
  1112.             };
  1113.           break;
  1114.  
  1115.         case XbWDDb_Str:
  1116.           XbWFDb_PutStr(T_OB,"W",1,(char*)XbWVWd_W.nm);
  1117.           break;
  1118.  
  1119.         };
  1120.       };
  1121.  
  1122.     };
  1123.   XbWFWd_SwitchTo(wname,0);
  1124.  
  1125.   return(0);
  1126.   };
  1127.  
  1128. /*}}}  */
  1129. /*{{{  XbWFOb_EdDpObj(     ***      Fuhrt edO aus*/
  1130. int  XbWFOb_EdDpObj(char *obn,int mode){
  1131.   XbWFOb_EditAndDisp(obn,mode);
  1132.   return(0);
  1133.  
  1134.   /* XbWDDb_DbIObj MOB; */
  1135.   /* MOB.onm = NULL;  */
  1136.   /* if (XbWFOb_GetPar(&XbWVWd_W,&MOB,obn,XbWDOb_GtAllP|XbWDOb_GetAnO) != NULL){ */
  1137.   /* XbWFOj_DiEdContents(&XbWVWd_W,&MOB,mode); */
  1138.   /* if (mode != 4){  */
  1139.   /*   if (mode){     */
  1140.   /*     XbWFOb_Edit(&MOB);*/
  1141.   /*     };           */
  1142.   /*   };             */
  1143.   /*  return(0);      */
  1144.   /*  };              */
  1145.   /* return(1);       */
  1146.   };
  1147. /*}}}  */
  1148.  
  1149. /*{{{  XbWFOj_DpColButt(   ***      Farbigen Knopf darstellen*/
  1150. void  XbWFOj_DpColButt(XbWDDb_DbIObj  *TO, int stat){
  1151.   double thenum,thedef;
  1152.   int res;
  1153.   char *ontext,*offtext,*txtstr,*oprstr;
  1154.  
  1155.   thenum = XbWFDb_GetNum(TO->chn,"V",1);
  1156.   txtstr = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"T",1);
  1157.   thedef = XbWFDb_GetNum(XbWVDb_ActGrp1,"v",1);
  1158.   ontext = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"1",1);
  1159.   offtext = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"0",1);
  1160.   oprstr = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"A",1);
  1161.   if (ontext == NULL){  ontext = "ON";  };
  1162.   if (offtext == NULL){  offtext = "  ";  };
  1163.   if (oprstr == NULL){oprstr = "=";};
  1164.  
  1165.   switch(oprstr[0]){
  1166.     case '=': res = (thenum==thedef); break;
  1167.     case '>': switch(oprstr[1]) {
  1168.                 case '=': res = (thenum>=thedef); break;
  1169.                 default:  res = (thenum>thedef); break;
  1170.                 };
  1171.               break;
  1172.     case '<': switch(oprstr[1]) {
  1173.                 case '=': res = (thenum<=thedef); break;
  1174.                 default:  res = (thenum<thedef); break;
  1175.                 };
  1176.               break;
  1177.     case '!': switch(oprstr[1]) {
  1178.                 case '=': res = (thenum!=thedef); break;
  1179.                 default:  res = ((1&((int)thenum)) != (1 & ((int)thedef))); break;
  1180.                 };
  1181.               break;
  1182.     case '&': res = ((int)thenum & (int)thedef);
  1183.               break;
  1184.     default: res = 0;
  1185.     };
  1186.   if (stat) { res = stat - 1; };
  1187.   if (res){
  1188.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x-2,XbWVOb_y, ontext, *TO->bkc,*TO->txc,XbWVGr_DGray);
  1189.     XbWSGr_HLin(   XbWVOb_X,XbWVOb_x-2,XbWVOb_y,XbWVGr_White);
  1190.     XbWSGr_VLin(   XbWVOb_x-2,XbWVOb_Y,XbWVOb_y,XbWVGr_White);
  1191.     }
  1192.   else {
  1193.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x-2,XbWVOb_y, offtext, *TO->bkc,*TO->txc,XbWVGr_White);
  1194.     XbWSGr_HLin(   XbWVOb_X,XbWVOb_x-2,XbWVOb_y,XbWVGr_DGray);
  1195.     XbWSGr_VLin(   XbWVOb_x-2,XbWVOb_Y,XbWVOb_y,XbWVGr_DGray);
  1196.     };
  1197.   if (txtstr != NULL){
  1198.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y+XbWFGr_THeight(),0,0,txtstr, *TO->bkc, *TO->txc, 0);
  1199.     };
  1200.   };
  1201. /*}}}  */
  1202. /*{{{  XbWFOj_DpLight(     ***      Light-Objekt (Lampe) darstellen*/
  1203. void  XbWFOj_DpLight(XbWDDb_DbIObj  *TO){
  1204.   double thenum,thedef;
  1205.   int res;
  1206.   char *ontext,*offtext,*txtstr,*oprstr;
  1207.  
  1208.   thenum = XbWFDb_GetNum(TO->chn,"V",1);
  1209.   txtstr = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"T",1);
  1210.   thedef = XbWFDb_GetNum(XbWVDb_ActGrp1,"v",1);
  1211.   ontext = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"1",1);
  1212.   offtext = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"0",1);
  1213.   oprstr = (char*)XbWFDb_VarInh(XbWVDb_ActGrp1,XbWDDb_Str,"A",1);
  1214.   if (ontext == NULL){  ontext = "ON";  };
  1215.   if (offtext == NULL){  offtext = "  ";  };
  1216.   if (oprstr == NULL){oprstr = "=";};
  1217.  
  1218.   switch(oprstr[0]){
  1219.     case '=': res = (thenum==thedef); break;
  1220.     case '>': switch(oprstr[1]) {
  1221.                 case '=': res = (thenum>=thedef); break;
  1222.                 default:  res = (thenum>thedef); break;
  1223.                 };
  1224.               break;
  1225.     case '<': switch(oprstr[1]) {
  1226.                 case '=': res = (thenum<=thedef); break;
  1227.                 default:  res = (thenum<thedef); break;
  1228.                 };
  1229.               break;
  1230.     case '!': switch(oprstr[1]) {
  1231.                 case '=': res = (thenum!=thedef); break;
  1232.                 default:  res = ((1&((int)thenum)) != (1 & ((int)thedef))); break;
  1233.                 };
  1234.               break;
  1235.     case '&': res = ((int)thenum & (int)thedef);
  1236.               break;
  1237.     default: res = 0;
  1238.     };
  1239.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TO->bkc,0,*TO->dfc);
  1240.   if (res){
  1241.     XbWSGr_TLBox(
  1242.       XbWVOb_x-XbWFGr_TWidth(ontext)-1,XbWVOb_Y,XbWVOb_x,XbWVOb_y,
  1243.       ontext,
  1244.       *TO->bfc,XbWFTb_ColCon(*TO->bfc),*TO->dfc);
  1245.     }
  1246.   else {
  1247.     XbWSGr_TLBox(
  1248.       XbWVOb_x-XbWFGr_TWidth(ontext)-1,XbWVOb_Y,XbWVOb_x,XbWVOb_y,
  1249.       offtext,
  1250.       *TO->bkc,XbWFTb_ColCon(*TO->bkc),*TO->dfc);
  1251.     };
  1252.   if (txtstr != NULL){
  1253.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,0,0,txtstr,*TO->bkc,*TO->txc,0);
  1254.     };
  1255.   XbWSGr_VLin(XbWVOb_X,XbWVOb_Y,XbWVOb_y,*TO->dfc);
  1256.   };
  1257. /*}}}  */
  1258. /*{{{  XbWFOj_DpArrow(     ***      Pfeil-Knopf darstellen*/
  1259. void  XbWFOj_DpArrow(XbWDDb_DbIObj  *TO, char *arrstr){
  1260.   if (arrstr == NULL){arrstr = "U";};
  1261.   {
  1262.     int mx,my,ax,ay,bx,by;
  1263.     mx = (XbWVOb_X+XbWVOb_x)/2;
  1264.     my = (XbWVOb_Y+XbWVOb_y)/2;
  1265.     ax = 4;
  1266.     ay = 3;
  1267.     bx = 3;
  1268.     by = 2;
  1269.  
  1270.     switch(arrstr[0]){
  1271.       case 'U': /* Up */
  1272.       case 'u':          XbWSGr_Line(mx,my-ay,mx,my+ay,(*TO->txc));
  1273.                          XbWSGr_Line(mx-bx,my,mx,my-ay,(*TO->txc));
  1274.                          XbWSGr_Line(mx+bx,my,mx,my-ay,(*TO->txc));
  1275.                          break;
  1276.       case 'D': /* Dn */
  1277.       case 'd':          XbWSGr_Line(mx,my-ay,mx,my+ay,(*TO->txc));
  1278.                          XbWSGr_Line(mx-bx,my,mx,my+ay,(*TO->txc));
  1279.                          XbWSGr_Line(mx+bx,my,mx,my+ay,(*TO->txc));
  1280.  
  1281.                          break;
  1282.       case 'R': /* Ri */
  1283.       case 'r':          XbWSGr_Line(mx-ax,my,mx+ax,my,(*TO->txc));
  1284.                          XbWSGr_Line(mx+ax,my,mx,my+by,(*TO->txc));
  1285.                          XbWSGr_Line(mx+ax,my,mx,my-by,(*TO->txc));
  1286.  
  1287.                          break;
  1288.       case 'L': /* Lf */
  1289.       case 'l':          XbWSGr_Line(mx-ax,my,mx+ax,my,(*TO->txc));
  1290.                          XbWSGr_Line(mx-ax,my,mx,my+by,(*TO->txc));
  1291.                          XbWSGr_Line(mx-ax,my,mx,my-by,(*TO->txc));
  1292.                          break;
  1293.       case 'T': /* Top */
  1294.       case 't':          XbWSGr_Line(mx-bx,my-ay,mx+bx,my-ay,(*TO->txc));
  1295.                          XbWSGr_Line(mx,my-ay,mx,my+ay,(*TO->txc));
  1296.                          XbWSGr_Line(mx-bx,my,mx,my-ay,(*TO->txc));
  1297.                          XbWSGr_Line(mx+bx,my,mx,my-ay,(*TO->txc));
  1298.                          break;
  1299.       case 'B': /* Bottom */
  1300.       case 'b':          XbWSGr_Line(mx-bx,my+ay,mx+bx,my+ay,(*TO->txc));
  1301.                          XbWSGr_Line(mx,my-ay,mx,my+ay,(*TO->txc));
  1302.                          XbWSGr_Line(mx-bx,my,mx,my+ay,(*TO->txc));
  1303.                          XbWSGr_Line(mx+bx,my,mx,my+ay,(*TO->txc));
  1304.  
  1305.                          break;
  1306.       case 'E': /* End */
  1307.       case 'e':          XbWSGr_Line(mx+ax,my-by,mx+ax,my+by,(*TO->txc));
  1308.                          XbWSGr_Line(mx-ax,my,mx+ax,my,(*TO->txc));
  1309.                          XbWSGr_Line(mx+ax,my,mx,my+by,(*TO->txc));
  1310.                          XbWSGr_Line(mx+ax,my,mx,my-by,(*TO->txc));
  1311.  
  1312.                          break;
  1313.       case 'S': /* Start */
  1314.       case 's':          XbWSGr_Line(mx-ax,my-by,mx-ax,my+by,(*TO->txc));
  1315.                          XbWSGr_Line(mx-ax,my,mx+ax,my,(*TO->txc));
  1316.                          XbWSGr_Line(mx-ax,my,mx,my+by,(*TO->txc));
  1317.                          XbWSGr_Line(mx-ax,my,mx,my-by,(*TO->txc));
  1318.                          break;
  1319.       };
  1320.     };
  1321.   };
  1322. /*}}}  */
  1323. /*{{{  XbWFOj_DpBool(      ***      Boolsche Lampe darstellen*/
  1324. void  XbWFOj_DpBool(XbWDDb_DbIObj  *TO){
  1325.   double thenum;
  1326.   thenum = XbWFDb_GetNum(TO->chn,"V",1);
  1327.   if (thenum > 0){
  1328.     thenum = 0.0;
  1329.     }
  1330.   else {
  1331.     thenum = 1.0;
  1332.     };
  1333.   XbWFDb_PutNum(TO->chn,"V",1,thenum);
  1334.   };
  1335. /*}}}  */
  1336. /*{{{  XbWFOj_DpBit(       ***      Bit-Lampe darstellen*/
  1337. void  XbWFOj_DpBit(XbWDDb_DbIObj  *TO){
  1338.   int thenum;
  1339.   int defnum;
  1340.   defnum = (int)XbWFDb_GetNum(TO->chn,"v",1);
  1341.   thenum = (int)XbWFDb_GetNum(TO->chn,"V",1);
  1342.   if ((thenum & defnum) > 0){
  1343.     thenum &= ~defnum;
  1344.     }
  1345.   else {
  1346.     thenum |= defnum;
  1347.     };
  1348.   XbWFDb_PutNum(TO->chn,"V",1,(double)thenum);
  1349.   };
  1350. /*}}}  */
  1351. /*{{{  XbWFOj_DpSwt(       ***      Switch-Lampe darstellen*/
  1352. void  XbWFOj_DpSwt(XbWDDb_DbIObj  *TO){
  1353.   double thenum;
  1354.   thenum = XbWFDb_GetNum(TO->chn,"v",1);
  1355.   XbWFDb_PutNum(TO->chn,"V",1,thenum);
  1356.   };
  1357. /*}}}  */
  1358. /*{{{  XbWFOj_DpEllipse(   ***      Ellipse zeichnen*/
  1359. void  XbWFOj_DpEllipse(XbWDDb_DbIObj  *TO){
  1360.   int stang,endang,ra,rb;
  1361.   stang = (int)XbWFDb_GetNum(TO->chn,"st_ang",1);
  1362.   endang = (int)XbWFDb_GetNum(XbWVDb_ActGrp1,"end_ang",1);
  1363.   if (!endang){
  1364.     endang = 360;
  1365.     };
  1366.   ra = (*TO->XB - *TO->XA)/2;
  1367.   rb = (*TO->YB - *TO->YA)/2;
  1368.   XbWSGr_Ell(*TO->XA+ra,*TO->YA+rb,stang,endang,ra,rb,*TO->dfc);
  1369.   };
  1370.  
  1371. /*}}}  */
  1372. /*{{{  XbWFOj_DpSlider(    ***      Slider zeichnen*/
  1373. void   XbWFOj_DpSlider(XbWDDb_DbIObj  *TO, int w_mode){
  1374.   double o_max, o_min, o_akt=0, o_sca, o_mag;
  1375.   double scale;
  1376.   int sl_len,sl_start,ii,tsl;
  1377.  
  1378.   ii = XbWFGr_TWidth("M")*2;
  1379.   tsl =  (TO->odt[2] == 'Y');
  1380.  
  1381.   o_sca = XbWFDb_GetNum(TO->chn,"sca",1);
  1382.   if (o_sca <= 0) {o_sca = 1.0;};
  1383.   o_min = XbWFDb_GetNum(TO->chn,"m",1);
  1384.   o_max = XbWFDb_GetNum(TO->chn,"M",1);
  1385.   o_mag = XbWFDb_GetNum(TO->chn,"mag",1);
  1386.   if (o_mag <= 0) {o_mag = 1.0;};
  1387.   if (o_max == 0) {o_max =  100;};
  1388.  
  1389.   if (!tsl) {
  1390.     scale = 1.0* (XbWVOb_x-XbWVOb_X-2.2*ii)/ (o_max-o_min);
  1391.     if (scale <= 0){return;};
  1392.  
  1393.     sl_len = 2.2*ii;
  1394.  
  1395.     if (w_mode){
  1396.       }
  1397.     else {
  1398.       o_akt = XbWFDb_GetNum(TO->chn,"V",1);
  1399.       };
  1400.  
  1401.     if (o_akt < o_min){o_akt = o_min;};
  1402.  
  1403.  
  1404.     sl_start = o_akt * scale;
  1405.     if (sl_start > XbWVOb_x-XbWVOb_X-sl_len){
  1406.       sl_start = XbWVOb_x-XbWVOb_X-sl_len;
  1407.       };
  1408.  
  1409.     XbWSGr_TLBox(XbWVOb_X, XbWVOb_Y, XbWVOb_x, XbWVOb_y, NULL, *TO->bkc, 0, *TO->dfc);
  1410.     XbWSGr_HLin(XbWVOb_X, XbWVOb_x, XbWVOb_Y+3, *TO->dfc);
  1411.     XbWSGr_HLin(XbWVOb_X, XbWVOb_x, XbWVOb_y-3, *TO->dfc);
  1412.  
  1413.     XbWSGr_TLBox(XbWVOb_X+sl_start,        XbWVOb_Y,
  1414.               XbWVOb_X+sl_start+sl_len, XbWVOb_y,
  1415.               NULL, *TO->bfc,0,*TO->dfc);
  1416.     XbWSGr_HLin(XbWVOb_X+sl_start+3,
  1417.            XbWVOb_X+sl_start+sl_len-3,
  1418.            (XbWVOb_Y+XbWVOb_y)/2,
  1419.       *TO->txc);
  1420.     }
  1421.   else {
  1422.     scale = 1.0* (XbWVOb_y-XbWVOb_Y-2.2*ii)/ (o_max-o_min);
  1423.     if (scale <= 0){return;};
  1424.  
  1425.     sl_len = 2.2*ii;
  1426.  
  1427.     if (w_mode){
  1428.       }
  1429.     else {
  1430.       o_akt = XbWFDb_GetNum(TO->chn,"V",1);
  1431.       };
  1432.  
  1433.     if (o_akt < o_min){o_akt = o_min;};
  1434.  
  1435.  
  1436.     sl_start = o_akt * scale;
  1437.     if (sl_start > XbWVOb_y-XbWVOb_Y-sl_len){
  1438.       sl_start = XbWVOb_y-XbWVOb_Y-sl_len;
  1439.       };
  1440.  
  1441.     XbWSGr_TLBox(XbWVOb_X, XbWVOb_Y, XbWVOb_x, XbWVOb_y, NULL, *TO->bkc,0,*TO->dfc);
  1442.     XbWSGr_VLin(XbWVOb_X+3, XbWVOb_Y, XbWVOb_y, *TO->dfc);
  1443.     XbWSGr_VLin(XbWVOb_x-3, XbWVOb_Y, XbWVOb_y, *TO->dfc);
  1444.  
  1445.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y+sl_start,
  1446.               XbWVOb_x,XbWVOb_Y+sl_start+sl_len,NULL, *TO->bfc,0,*TO->dfc);
  1447.     XbWSGr_VLin((XbWVOb_X+XbWVOb_x)/2,XbWVOb_Y+sl_start+3,
  1448.            XbWVOb_Y+sl_start+sl_len-3,
  1449.       *TO->txc);
  1450.     };
  1451.  
  1452.   XbWFDb_PutNum(TO->chn,"V",1,o_akt);
  1453.  
  1454.   };
  1455. /*}}}  */
  1456.  
  1457. /*{{{  XbWFOj_SpawnTsk(    ***      taskstart durchfuhren als Obj-Aktion*/
  1458. void  XbWFOj_SpawnTsk(XbWDDb_DbIWdw  *TW,XbWDDb_DbIObj  *TO,
  1459.     unsigned char styp, unsigned char write_tbl, unsigned char ttyp,
  1460.     unsigned char no_params){
  1461.   char sstr[200],*inh,*tsk_dir,*tsk_name;
  1462.   FILE *wtfp;
  1463.   int xa,ya,xb,yb;
  1464.  
  1465.  
  1466.   XbWFTb_Message("About to spawn task...");
  1467.  
  1468.  
  1469.   xa = *TW->nx;   ya = *TW->ny;
  1470.   xb = xa;        yb = ya;
  1471.  
  1472.   xa += XbWVIDEO_XA; ya += XbWVIDEO_YA;
  1473.   xb = xa;        yb = ya;
  1474.  
  1475.   xa += *TO->XA;  ya += *TO->YA;
  1476.   xb += *TO->XB;  yb += *TO->YB;
  1477.  
  1478.   xa++;           ya++;
  1479.  
  1480.   if (xb > XbWVIDEO_XB) {  xb = XbWVIDEO_XB;  };
  1481.   if (yb > XbWVIDEO_YB) {  yb = XbWVIDEO_YB;  };
  1482.  
  1483.   if ((tsk_dir = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"td",1)) == NULL) {
  1484.     tsk_dir = "";
  1485.     };
  1486.  
  1487.   if ((inh = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"tn",1)) != NULL) {
  1488.  
  1489.     {
  1490.       char ctsk_dir[60];
  1491.       int ii;
  1492.       tsk_name = inh;
  1493.       strcpy(ctsk_dir,(char*)XbWFTb_PckTxt(tsk_dir));
  1494.       ii = strlen(ctsk_dir);
  1495. #ifdef XbW_SYSDEF_TC3_VERSION
  1496.       if (ctsk_dir[ii-1] == '\\' ) {
  1497.         ctsk_dir[ii-1] = 0;
  1498.         };
  1499.       chdir(ctsk_dir);
  1500. #else
  1501.       if (ctsk_dir[ii-1] == '/' ) {
  1502.         ctsk_dir[ii-1] = 0;
  1503.         };
  1504.       { int kk;
  1505.         for(kk=0;kk<ii-1;kk++){
  1506.           if (ctsk_dir[kk] == '\\' ) {
  1507.             ctsk_dir[kk] = '/';
  1508.             };
  1509.           };
  1510.         };
  1511. #endif
  1512.       };
  1513.     switch (no_params) {
  1514.       case 'P':
  1515.         #ifdef XbW_SYSDEF_TC3_VERSION
  1516.           sprintf(sstr,"%s d%s\\ XA%d YA%d XB%d YB%d",inh,tsk_dir,xa,ya,xb,yb);
  1517.         #else
  1518.           sprintf(sstr,"%s d%s/ XA%d YA%d XB%d YB%d",inh,tsk_dir,xa,ya,xb,yb);
  1519.         #endif
  1520.  
  1521.         break;
  1522.       default :
  1523.         sprintf(sstr,"%s",inh);
  1524.         break;
  1525.       };
  1526.     XbWFGr_CurOFF();
  1527.     XbWFGr_PushPort();
  1528.     switch (styp) {
  1529.       case 'v':
  1530.       case 'V':
  1531.         if ((inh = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"wtfil",1)) != NULL) {
  1532.           while ((wtfp = XbWSSy_fopen(inh,"rb")) == NULL){};
  1533.           fclose(wtfp);
  1534.           };
  1535.         break;
  1536.       default :
  1537.         switch (write_tbl) {
  1538.           case 's':
  1539.           case 'S': {
  1540.                     void  *ap[4] = {(void *)3,
  1541.                                         (void *)"actual",
  1542.                                         (void *)"\\xw\\x\\sys\\",
  1543.                                         (void *)0 };
  1544.                     int at[4] = { XbWDMf_IntPar,
  1545.                                   XbWDMf_StrPar,
  1546.                                   XbWDMf_StrPar,
  1547.                                   XbWDMf_IntPar };
  1548.                     char obn[40];
  1549.                     char win[40];
  1550.                     strcpy(obn,(char*)TO->onm);
  1551.                     strcpy(win,(char*)TW->nm);
  1552.                     XbWFDb_WrTable(&ap,&at);
  1553.                     XbWFDb_CloseSys();
  1554.                     switch(ttyp){
  1555.                       case 't':
  1556.                       case 'T':
  1557.                                XbWSGr_Close();
  1558.                                break;
  1559.                       };
  1560.  
  1561.                     if(XbWPSy_EXETaskStartHook(tsk_name,TW,TO)){
  1562.                       system(sstr);
  1563.                       };
  1564.                     switch(ttyp){
  1565.                       case 'c':
  1566.                       case 'C':
  1567.                                break;
  1568.                       case 'p':
  1569.                       case 'P':
  1570.                       case 't':
  1571.                       case 'T':
  1572.                                XbWSGr_ResMode();
  1573.                                XbWSMs_DrInit();
  1574.                                break;
  1575.                       };
  1576.                     XbWFDb_RdTable(&ap,&at);
  1577.                     switch(ttyp){
  1578.                       case 'c':
  1579.                       case 'C':
  1580.                                break;
  1581.                       case 'p':
  1582.                       case 'P':
  1583.                       case 't':
  1584.                       case 'T':
  1585.                                XbWFWd_BackGr();
  1586.                              /*  XbWFWd_DrawAll(); */
  1587.                                break;
  1588.                       };
  1589.                     XbWFWd_SwitchTo(win,0);
  1590.                     *TW = XbWVWd_W;
  1591.                     if (XbWFOb_GetPar(TW,TO,obn,XbWDOb_GtAllP|XbWDOb_GetAnO) == NULL){
  1592.                       XbWSPu_Alarm("Error in Database");
  1593.                       };
  1594.  
  1595.                     XbWVOb_X = *TO->XA;  XbWVOb_Y = *TO->YA;
  1596.                     XbWVOb_x = *TO->XB;  XbWVOb_y = *TO->YB;
  1597.  
  1598.                     };
  1599.                     break;
  1600.  
  1601.           default:  {
  1602.                     char obn[40];
  1603.                     strcpy(obn,(char*)TO->onm);
  1604.                     switch(ttyp){
  1605.                       case 't':
  1606.                       case 'T':
  1607.                                XbWSGr_Close();
  1608.                                break;
  1609.                       };
  1610.                     if(XbWPSy_EXETaskStartHook(tsk_name,TW,TO)){
  1611.                       system(sstr);
  1612.                       };
  1613.                     switch(ttyp){
  1614.                       case 'c':
  1615.                       case 'C':
  1616.                                break;
  1617.                       case 'p':
  1618.                       case 'P':
  1619.                       case 't':
  1620.                       case 'T':
  1621.                                XbWSGr_ResMode();
  1622.                                XbWSMs_DrInit();
  1623.                                XbWFWd_BackGr();
  1624.                                /* XbWFWd_DrawAll(); */
  1625.                                if (XbWFOb_GetPar(TW,TO,obn,XbWDOb_GtAllP|XbWDOb_GetAnO) == NULL){
  1626.                                  XbWSPu_Alarm("Error in Database");
  1627.                                  };
  1628.                                XbWVOb_X = *TO->XA;  XbWVOb_Y = *TO->YA;
  1629.                                XbWVOb_x = *TO->XB;  XbWVOb_y = *TO->YB;
  1630.                                break;
  1631.                       };
  1632.                     };
  1633.                     break;
  1634.           };
  1635.         break;
  1636.       };
  1637.  
  1638.     XbWFGr_SetPort();
  1639.     XbWSMs_Init();
  1640.     XbWSMs_ON();
  1641.     XbWSMs_OFF();
  1642.     XbWSMs_ResPos();
  1643.     XbWFGr_PopPort();
  1644.     XbWFGr_ResPort();
  1645.     XbWSGr_GotoXY(1,1);
  1646. #ifdef XbW_SYSDEF_TC3_VERSION
  1647.     chdir("\\xw\\code\\bin");
  1648. #endif
  1649.     };
  1650.   };
  1651.  
  1652. /*}}}  */
  1653.  
  1654. /*{{{  XbWFOj_EdCyc(       ***      Zyklisches Objekt editieren*/
  1655. void  XbWFOj_EdCyc(XbWDDb_DbIObj  *TO){
  1656.   char * text;
  1657.   int thedef;
  1658.   char *textstr;
  1659.   char sstr[30];
  1660.  
  1661.   text = XbWFDb_VarInh(TO->chn,XbWDDb_Str,"V",1);
  1662.   thedef = XbWFDb_GetNum(TO->chn,"v",1);
  1663.   thedef++;
  1664.   sprintf(sstr,"Text%d",thedef);
  1665.  
  1666.   textstr = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,sstr,1);
  1667.   if (textstr == NULL){
  1668.     textstr = XbWFDb_VarInh(TO->chn,XbWDDb_Str,"Text-1",1);
  1669.     if (textstr == NULL){
  1670.       textstr = "";
  1671.       };
  1672.     thedef = -1;
  1673.     };
  1674.  
  1675.   strcpy(text,textstr);
  1676.   XbWFDb_PutNum(TO->chn,"v",1,thedef);
  1677.   };
  1678.  
  1679. /*}}}  */
  1680. /*{{{  XbWFOj_DpCyc(       ***      Zyklisches Objekt darstellen*/
  1681. void  XbWFOj_DpCyc(XbWDDb_DbIObj  *TO){
  1682.   char * text;
  1683.   int thedef;
  1684.   char *textstr;
  1685.   char sstr[30];
  1686.  
  1687.   text = XbWFDb_VarInh(TO->chn,XbWDDb_Str,"V",1);
  1688.   thedef = XbWFDb_GetNum(TO->chn,"v",1);
  1689. /*   thedef++;  weglassen: der Unterschied zu EdCyc! */
  1690.   sprintf(sstr,"Text%d",thedef);
  1691.  
  1692.   textstr = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,sstr,1);
  1693.   if (textstr == NULL){
  1694.     textstr = XbWFDb_VarInh(TO->chn,XbWDDb_Str,"Text-1",1);
  1695.     if (textstr == NULL){
  1696.       textstr = "";
  1697.       };
  1698.     thedef = -1;
  1699.     };
  1700.  
  1701.   strcpy(text,textstr);
  1702. /*   XbWFDb_PutNum(TO->chn,"v",1,thedef); weglassen. s.o. */
  1703.   };
  1704.  
  1705. /*}}}  */
  1706. /*{{{  XbWFOj_Ed_Y(        ***      Ruft XbWOj_EdCyc*/
  1707. int  XbWFOj_Ed_Y(int edit, XbWDDb_DbIObj  *TOB){
  1708.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  1709.   if (edit==3){ return(0);};
  1710.   XbWFOj_EdCyc(TOB);
  1711.   return(1);
  1712.   };
  1713.  
  1714. /*}}}  */
  1715. /*{{{  XbWFOj_Dp_Y(        ***      Ruft XbWOj_DpCyc*/
  1716. int  XbWFOj_Dp_Y(XbWDDb_DbIObj  *TOB){
  1717.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  1718.   XbWFOj_DpCyc(TOB);
  1719.   XbWFOj_Dp_S(TOB);
  1720.   return(1);
  1721.   };
  1722.  
  1723. /*}}}  */
  1724. /*{{{  XbWFOj_EdSwt(       ***      Switch-Lampe editieren*/
  1725. void  XbWFOj_EdSwt(XbWDDb_DbIObj  *TO){
  1726.   double thenum,thedef;
  1727.   char *oprstr;
  1728.  
  1729.   thenum = XbWFDb_GetNum(TO->chn,"V",1);
  1730.   thedef = XbWFDb_GetNum(TO->chn,"v",1);
  1731.  
  1732.   oprstr = (char*)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"A",1);
  1733.   if (oprstr == NULL){oprstr = "=";};
  1734.  
  1735.   switch(oprstr[0]){
  1736.     case '=': thenum=thedef; break;
  1737.     case '&': thenum = (int)thenum & ((int)thedef);
  1738.               break;
  1739.     case '|': thenum = (int)thenum | ((int)thedef);
  1740.               break;
  1741.     case '-': thenum -= thedef; break;
  1742.     case '+': thenum += thedef; break;
  1743.     case '/': thenum /= thedef; break;
  1744.     case '*': thenum *= thedef; break;
  1745.     };
  1746.   XbWFDb_PutNum(TO->chn,"V",1,thenum);
  1747.   };
  1748.  
  1749. /*}}}  */
  1750. /*{{{  XbWFOj_EdStr(       ***      String-Objekt editieren*/
  1751. void  XbWFOj_EdStr(XbWDDb_DbIObj  *TO){
  1752.   char merker[200], *ms;
  1753.   char sstr[20];
  1754.   int vtp;
  1755.   int SL,kk;
  1756.   strcpy(sstr,"V");
  1757.   XbWFDb_GetInf(TO->chn, -1, sstr, &vtp, &ms, &SL, 1);
  1758.   if (ms != NULL) {
  1759.     if (SL < 1) {
  1760.       SL = strlen(ms)+1;
  1761.       kk = SL-2;
  1762.       }
  1763.     else {
  1764.       kk = strlen(ms)-1;
  1765.       };
  1766.     if (strchr(ms,13) != NULL) {
  1767.       *((char*)strchr(ms,13)) = 0;
  1768.       };
  1769.     if (strchr(ms,10) != NULL) {
  1770.       *((char*)strchr(ms,10)) = 0;
  1771.       };
  1772.     while ((kk >= 0) & (ms[kk] == ' ')) {
  1773.       ms[kk]=0;
  1774.       kk--;
  1775.       };
  1776.     strcpy(merker,ms);
  1777.     XbWFEd_GetOStr(&XbWVWd_W,merker,190,0,0,XbWVOb_x-XbWVOb_X,XbWVOb_y-XbWVOb_Y, merker,
  1778.          ((XbWVMs_XPos - *XbWVWd_W.nx - *TO->XA) / XbWFGr_TWidth("M"))
  1779.      );
  1780.     strncpy(ms,merker,SL-1);
  1781.     ms[SL-1] = 0;
  1782.     };
  1783.   };
  1784. /*}}}  */
  1785. /*{{{  XbWFOj_GetNum(      ***      Unterfunktion zu EdInt*/
  1786. double  XbWFOj_GetNum(XbWDDb_DbIObj  *TO){
  1787.   double thenum;
  1788.   char tx[60],ttx[60];
  1789.   double off,sca,una;
  1790.   char *tfor,*teha;
  1791.  
  1792. /* ---------------- Zahl laden ------------------------------------------- */
  1793.   thenum = XbWFDb_GetNum(TO->chn,"V",1);
  1794.  
  1795. /* ---------------- Faktoren, Einheiten setzen --------------------------- */
  1796.   off = XbWFDb_GetNum(TO->chn,"off",1);  thenum += off;
  1797.   sca = XbWFDb_GetNum(TO->chn,"sca",1);  if (sca) {thenum *= sca;};
  1798.   una = XbWFDb_GetNum(TO->chn,"una",1);  if (una) {thenum *= una;};
  1799.  
  1800.   switch (*TO->odt){
  1801.     case 'i':
  1802.     case 'I':
  1803.              itoa((int)thenum,tx,10); break;
  1804.     case 'h':
  1805.     case 'H':
  1806.              itoa((int)thenum,tx,16); break;
  1807.     default:
  1808.              tfor = (char *)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"fmt",1);
  1809.              if (tfor != NULL) {
  1810.                sprintf(tx,tfor,thenum);
  1811.                }
  1812.              else {
  1813.                sprintf(tx,"%40.12f",thenum);
  1814.                strcpy(tx,(char *)XbWFTb_PckTxt(tx));
  1815.                };
  1816.              break;
  1817.     };
  1818.   /* ---------- Einheit setzen ------------- */
  1819.   teha = (char *)XbWFDb_VarInh(TO->chn,XbWDDb_Str,"eha",1);
  1820.   if (teha != NULL) {
  1821.     if (strchr(teha,'%') != NULL) {
  1822.       /* -------- Wenn formatstring angegeben, SCALE einbeziehen (!) */
  1823.       sprintf(ttx,teha,sca);
  1824.       strcat(tx,ttx);
  1825.       }
  1826.     else {
  1827.       strcat(tx,teha);
  1828.       };
  1829.     };
  1830.   strcpy(XbWVOb_GTxt,tx);
  1831.   return(thenum);
  1832.   };
  1833.  
  1834.  
  1835. /*}}}  */
  1836. /*{{{  XbWFOj_PutNum(*/
  1837. double  XbWFOj_PutNum(XbWDDb_DbIObj  *TO){
  1838.   double thenum,off,una,sca;
  1839.   char tx[60];
  1840.  
  1841.   strcpy(tx,XbWVOb_GTxt);
  1842.   if (strchr(tx,'[') != NULL) {
  1843.     *((char*)strchr(tx,'[')) = 0;
  1844.     };
  1845.  
  1846.   thenum = atof(tx);
  1847.  
  1848. /* ---------------- Faktoren, Einheiten setzen --------------------------- */
  1849.   off = XbWFDb_GetNum(TO->chn,"off",1);
  1850.   sca = XbWFDb_GetNum(TO->chn,"sca",1);
  1851.   una = XbWFDb_GetNum(TO->chn,"una",1);
  1852.  
  1853.   if (una) {thenum /= una;};
  1854.   if (sca) {thenum /= sca;};
  1855.   if (off) {thenum -= off;};
  1856.   return(thenum);
  1857.   };
  1858. /*}}}  */
  1859. /*{{{  XbWFOj_EdInt(       ***      Integer-Objekt editieren*/
  1860. void  XbWFOj_EdInt(XbWDDb_DbIObj  *TO){
  1861.   double mrk,act,min,max,def;
  1862.   char helpline[180];
  1863.   char merker[100];
  1864.   int weg;
  1865.  
  1866.   mrk = XbWFOj_GetNum(TO);
  1867.  
  1868.   max = (double)XbWFDb_GetNum(TO->chn,"M",1);
  1869.   def = (double)XbWFDb_GetNum(TO->chn,"v",1);
  1870.   min = (double)XbWFDb_GetNum(TO->chn,"m",1);
  1871.  
  1872.   {
  1873.     int ii;
  1874.     ii = 0;
  1875.     while ( XbWVOb_GTxt[ii] == ' ') {
  1876.       ii++;
  1877.       };
  1878.     strcpy(merker,(char*)&XbWVOb_GTxt[ii]);
  1879.     };
  1880.  
  1881.   newinput:
  1882.   sprintf(helpline," min:%12.7f def:%12.7f max:%12.7f;",min,def,max);
  1883.  
  1884.  
  1885.   XbWFEd_GetOStr(&XbWVWd_W,(char *)&merker,98,
  1886.     0,0,XbWVOb_x-XbWVOb_X,XbWVOb_y-XbWVOb_Y,    helpline,0);
  1887.  
  1888.   strcpy(XbWVOb_GTxt,(char *)XbWFTb_PckTxt(merker));
  1889.  
  1890.   act = XbWFOj_PutNum(TO);
  1891.  
  1892.   if ( ((act > max) | (act < min)) & (max != min) ) {
  1893.     sprintf(helpline,"%12.7f ... %12.7f;",min,max);
  1894.     weg = XbWFTb_SubPopUpBox("Sorry, but your input exceeds range",
  1895.         helpline,
  1896.         " Use default"," New input"," Use oldval");
  1897.     XbWSMs_SetArrowCursor();
  1898.     switch (weg) {
  1899.       case (1):  act = def;     break;
  1900.       case (2):
  1901.         XbWFOb_SetViewPort(&XbWVWd_W,TO);
  1902.         goto newinput;
  1903.       case (3):  act = mrk;     break;
  1904.       };
  1905.     };
  1906.  
  1907. /* ---------------- Zahl speichern --------------------------------------- */
  1908.   XbWFDb_PutNum(TO->chn,"V",1,act);
  1909.   };
  1910.  
  1911. /*}}}  */
  1912. /*{{{  XbWFOj_EdSlider(    ***      Slider verschieben*/
  1913. void  XbWFOj_EdSlider(XbWDDb_DbIObj  *TO){
  1914.   int asl_start,Mausx,Mausy,tsl,AMausx,AMausy,BMausx,BMausy;
  1915.   double o_max, o_min, o_akt;
  1916.   double scale;
  1917.   int sl_len,sl_start,ii;
  1918.   void  *oldcursor;
  1919.  
  1920.   tsl =  (TO->odt[2] == 'Y');
  1921.  
  1922.   ii = XbWFGr_TWidth("M")*2;
  1923.   o_akt = XbWFDb_GetNum(TO->chn,"V",1);
  1924.   o_min = XbWFDb_GetNum(TO->chn,"m",1);
  1925.   o_max = XbWFDb_GetNum(TO->chn,"M",1);
  1926.   if (o_max == 0) {o_max =  100;};
  1927.  
  1928.   if (!tsl) {
  1929.     scale = 1.0* (XbWVOb_x-XbWVOb_X -2.2*ii) / (o_max-o_min);
  1930.     }
  1931.   else {
  1932.     scale = 1.0* (XbWVOb_y-XbWVOb_Y -2.2*ii) / (o_max-o_min);
  1933.     };
  1934.   if (scale <= 0){return;};
  1935.  
  1936.   sl_len = 2.2 * ii;
  1937.   if (o_akt < o_min){o_akt = o_min;};
  1938.   if (o_akt > o_max){o_akt = o_max;};
  1939.   sl_start = o_akt * scale;
  1940.  
  1941.   XbWVMs_XPos = *XbWVWd_W.nx+(*TO->XA+*TO->XA)/2;
  1942.   XbWVMs_YPos = *XbWVWd_W.ny+(*TO->YA+*TO->YA)/2;
  1943.   if (!tsl) {
  1944.     XbWVMs_XPos = *XbWVWd_W.nx+*TO->XA+sl_start;
  1945.     XbWVMs_YPos = *XbWVWd_W.ny+*TO->YB;
  1946.     }
  1947.   else {
  1948.     XbWVMs_XPos = *XbWVWd_W.nx+*TO->XB;
  1949.     XbWVMs_YPos = *XbWVWd_W.ny+*TO->YA+sl_start;
  1950.     };
  1951.   AMausx = XbWVMs_XPos;
  1952.   AMausy = XbWVMs_YPos;
  1953.   BMausx = -10;
  1954.   BMausy = -10;
  1955.   XbWSMs_Warp(XbWVMs_XPos,XbWVMs_YPos);
  1956.  
  1957.   oldcursor = XbWSMs_SetHandCursor();
  1958.   XbWSMs_IsAKey(0);
  1959.   XbWVMs_LButt = 1;
  1960.   asl_start = sl_start;
  1961.   while (XbWVMs_LButt){
  1962.     XbWSMs_ButUp(0);
  1963.     XbWFGr_CurON();
  1964.     Mausx = XbWVMs_XPos-AMausx;
  1965.     Mausy = XbWVMs_YPos-AMausy;
  1966.  
  1967.     if ((BMausx != Mausx)|(BMausy != Mausy)){
  1968.       BMausx = Mausx; BMausy = Mausy;
  1969.       if (!tsl) {
  1970.         sl_start = asl_start + Mausx;
  1971.         if (sl_start > XbWVOb_x-XbWVOb_X-sl_len){
  1972.           sl_start = XbWVOb_x-XbWVOb_X-sl_len;
  1973.           };
  1974.         }
  1975.       else {
  1976.         sl_start = asl_start + Mausy;
  1977.         if (sl_start > XbWVOb_y-XbWVOb_Y-sl_len){
  1978.           sl_start = XbWVOb_y-XbWVOb_Y-sl_len;
  1979.           };
  1980.         };
  1981.       o_akt = sl_start/scale;
  1982.       if (o_akt < o_min){o_akt = o_min;};
  1983.       if (o_akt > o_max){o_akt = o_max;};
  1984.       sl_start = o_akt * scale;
  1985.       XbWFDb_PutNum(TO->chn,"V",1,o_akt);
  1986.       XbWFOj_DpSlider(TO,0);
  1987.       };
  1988.     };
  1989.   XbWSMs_SetLastCursor(oldcursor);
  1990.   };
  1991. /*}}}  */
  1992. /*{{{  XbWFOj_Ed_Z(        ***      Projektname editieren*/
  1993. int  XbWFOj_Ed_Z(int edit, XbWDDb_DbIObj  *TOB){
  1994.   int atp,ale;
  1995.   char aov[16], *ain;
  1996.  
  1997.   XbWDDb_DbIVar  *gr_st;
  1998.  
  1999.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2000.   if (edit==3){ return(0);};
  2001.  
  2002.   gr_st = (XbWDDb_DbIVar *)XbWDDb_DbIPrj;
  2003.  
  2004.   if (XbWFDb_GetInf(gr_st,0,aov,&atp,&ain,&ale,0)) {
  2005.     if (atp == XbWDDb_Str) {
  2006.       XbWFDb_PutStr(TOB->chn,"V",1,ain);
  2007.       };
  2008.     };
  2009.   return(1);
  2010.   };
  2011.  
  2012. /*}}}  */
  2013.  
  2014. /*{{{  XbWFOj_DiEdContents(***      Hauptroutine Disp&Edit nach Mausclick*/
  2015. void  XbWFOj_DiEdContents(XbWDDb_DbIWdw  *WI, XbWDDb_DbIObj  *TOB, int edit){
  2016.   int todisp = 1;
  2017.   int m_stat = XbWVMs_CSet;
  2018.   if (!(*TOB->dst)) {return;};
  2019.   XbWFGr_CurOFF();
  2020.   if (edit != 0) {
  2021.     if (!(*TOB->est)){return;};
  2022.  
  2023.     if (*WI->wfe != 0) {
  2024.       *WI->wfx = 1;
  2025.       XbWFGr_CurOFF();
  2026.       XbWVMs_CFrm = kreuz;
  2027.       };
  2028.     };
  2029.   XbWFGr_PushPort();
  2030.   XbWFOb_SetViewPort(&XbWVWd_W,TOB);
  2031.   XbWVOb_X =   XbWVOb_Y = 0;
  2032.   XbWVOb_x = *TOB->XB-*TOB->XA;  XbWVOb_y = *TOB->YB-*TOB->YA;
  2033.  
  2034.   if (edit != 0) {
  2035.     if (TOB->oet != NULL){
  2036.       switch(TOB->oet[0]){
  2037.         case '@':
  2038.             XbWPSy_EditObjectHook(
  2039.               (char*)TOB->oet,
  2040.               WI,TOB,
  2041.               &todisp,edit,
  2042.               XbWVOb_ox-*TOB->XA,
  2043.               XbWVOb_oy-*TOB->YA);
  2044.           break;
  2045.         case '#': todisp = XbWFOj_EdCalc(edit,TOB); break;
  2046.         case 'A': todisp = XbWFOj_Ed_A(edit,TOB,0); break;
  2047.         case 'a': todisp = XbWFOj_Ed_A(edit,TOB,1); break;
  2048.         case 'B': todisp = XbWFOj_Ed_B(edit,TOB); break;
  2049.         case 'C': todisp = XbWFOj_Ed_C(edit,TOB); break;
  2050.         case 'D': todisp = XbWFOj_Ed_HID(edit,TOB); break;
  2051.         case 'F': todisp = XbWFOj_Ed_F(edit,TOB); break;
  2052.         case 'G': todisp = XbWFOj_Ed_G(edit,TOB); break;
  2053.         case 'H': todisp = XbWFOj_Ed_HID(edit,TOB); break;
  2054.         case 'I': todisp = XbWFOj_Ed_HID(edit,TOB); break;
  2055.         case 'L': todisp = XbWFOj_Ed_L(edit,TOB); break;
  2056.         case 'M': todisp = XbWFOj_Ed_M(edit,TOB); break;
  2057.         case 'N': todisp = XbWFOj_Ed_N(edit,TOB); break;
  2058.         case 'R': todisp = XbWFOj_Ed_R(edit,TOB); break;
  2059.         case 'S': todisp = XbWFOj_Ed_S(edit,TOB); break;
  2060.         case 'T': todisp = XbWFOj_Ed_T(&XbWVWd_W,edit,TOB); break;
  2061.         case 'U': todisp = XbWFOj_Ed_U(edit,TOB); break;
  2062.         case 'V': todisp = XbWFOj_Ed_V(edit,TOB); break;
  2063.         case 'X': todisp = XbWFOj_Ed_X(edit,TOB); break;
  2064.         case 'Y': todisp = XbWFOj_Ed_Y(edit,TOB); break;
  2065.         case 'Z': todisp = XbWFOj_Ed_Z(edit,TOB); break;
  2066.         case '.': todisp=1; break;
  2067.         };
  2068.       };
  2069.  
  2070.     };
  2071.  
  2072.   if ((todisp) && ( TOB->odt != NULL)){
  2073.     switch(TOB->odt[0]){
  2074.       case '@': XbWPSy_DisplayObjectHook((char *)TOB->odt,WI,TOB);
  2075.                 break;
  2076.       case '#': XbWFOj_EdCalc(0,TOB); break;
  2077.       case 'R': XbWFOj_Dp_R(TOB); break;
  2078.       case 'N': XbWFOj_Dp_N(TOB); break;
  2079.       case 'A': XbWFOj_Dp_A(TOB,0); break;
  2080.       case 'C': XbWSSy_ObjDispIcon(TOB); break;
  2081.       case 'a': XbWFOj_Dp_A(TOB,1); break;
  2082.       case 'G': XbWFOj_Dp_G(TOB); break;
  2083.       case 'S': XbWFOj_Dp_S(TOB); break;
  2084.       case 'I':
  2085.       case 'D':
  2086.       case 'H': XbWFOj_DpInt(TOB); break;
  2087.       case 'B':
  2088.       case 'L': XbWFOj_DpLight(TOB); break;
  2089.       case 'M': XbWFOj_Dp_M(TOB); break;
  2090.       case '/': XbWFOj_Dp_BKS(TOB); break;
  2091.       case 'P': XbWFOj_Dp_P(TOB); break;
  2092.       case 'T': XbWFOj_Dp_T(TOB); break;
  2093.       case 'X': XbWFOj_Dp_X(TOB); break;
  2094.       case 'Y': XbWFOj_Dp_Y(TOB); break;
  2095.       case 'Z': XbWFOj_Dp_Z(TOB); break;
  2096.       case '.': break;
  2097.       };
  2098.     };
  2099.  
  2100.   XbWFGr_PopPort(); XbWFGr_ResPort();
  2101.   if (m_stat){
  2102.     XbWFGr_CurON();
  2103.     };
  2104.   };
  2105. /*}}}  */
  2106. /*{{{  XbWFOj_Ed_N(        ***,PRJ  Variablenname in Var-Inh. eintragen*/
  2107. int  XbWFOj_Ed_N(int edit, XbWDDb_DbIObj  *TOB){
  2108.   int anr,aof,atp,ale,ii;
  2109.   char aov[16], *ain;
  2110.  
  2111.   XbWDDb_DbIVar  *gr_st;
  2112.  
  2113.   if (edit==3){
  2114.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2115.     return(0);
  2116.     };
  2117.  
  2118.   aof = (int)  XbWFDb_GetNum(TOB->chn,"ao",1);
  2119.   anr = (int)  XbWFDb_GetNum(TOB->chn,"an",1);
  2120.  
  2121.   gr_st = (XbWDDb_DbIVar *)XbWDDb_DbIPrj;
  2122.  
  2123.   for (ii = 0; ii < aof+anr; ii++) {
  2124.     if ((gr_st->tp & XbWDDb_Typ) == XbWDDb_GPtr) {
  2125.       return(0);
  2126.       };
  2127.     XbWFDb_ForWd(&gr_st,XbWDDb_DbISys);
  2128.     };
  2129.  
  2130.   if (XbWFDb_GetInf(gr_st,0,aov,&atp,&ain,&ale,0)) {
  2131.     XbWFDb_PutStr(TOB->chn,"V",1,aov);
  2132.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,aov,*TOB->bkc,*TOB->txc,*TOB->bfc);
  2133.     };
  2134.   return(1);
  2135.   };
  2136. /*}}}  */
  2137. /*{{{  XbWFOj_Ed_G(        ***,PRJ  Gruppenname in Var-Inh. eintragen*/
  2138. int  XbWFOj_Ed_G(int edit, XbWDDb_DbIObj  *TOB){
  2139. /* Gruppenname darstellen;
  2140.      "al" Name der Liste
  2141.      "an" ist startnummer der Gruppe zum Darstellen
  2142.      "ao" ist listen-offset zu an; */
  2143.  
  2144.   int anr,aof,atp,ale,ii;
  2145.   char aov[16], *ain;
  2146.   char *agr, *aon;
  2147.  
  2148.   XbWDDb_DbIVar  *gr_st;
  2149.  
  2150.   if (edit ==3){
  2151.     XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2152.     return(0);
  2153.     };
  2154.  
  2155.   agr = (char*)XbWFDb_VarInh(TOB->chn,XbWDDb_Str,"al",1);
  2156.   aon = (char*)XbWFDb_VarInh(TOB->chn,XbWDDb_Str,"V",1);
  2157.   anr = (int)  XbWFDb_GetNum(TOB->chn,"an",1);
  2158.   aof = (int)  XbWFDb_GetNum(TOB->chn,"ao",1);
  2159.  
  2160.   gr_st = XbWFDb_FindGrp(agr,NULL);
  2161.   for (ii = 0; ii < aof+anr; ii++) {
  2162.     gr_st = XbWFDb_NextGrp(gr_st,NULL);
  2163.     };
  2164.  
  2165.   if (XbWFDb_GetInf(gr_st,0,aov,&atp,&ain,&ale,0)) {
  2166.     switch (atp) {
  2167.       case XbWDDb_Str: strcpy(aon,ain);
  2168.                    break;
  2169.       };
  2170.     };
  2171.   return(1);
  2172.   };
  2173. /*}}}  */
  2174. /*{{{  XbWFOj_Ed_R(        ***,PRJ  Zeile aus Textdatei editieren*/
  2175. int  XbWFOj_Ed_R(int edit, XbWDDb_DbIObj  *TOB){
  2176.   /* enthält eine Zeile aus einer Textdatei (TFRL lang) */
  2177.   int dfl,off,str_len;
  2178.   char *fname;
  2179.   FILE *fp,*cfp;
  2180.   char cstr[200],sstr[200];
  2181.   int ii;
  2182.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2183.   if (edit==3){ return(0);};
  2184.   fname = (char*)XbWFDb_VarInh(TOB->chn,XbWDDb_Str,"V",1);
  2185.   if (fname != NULL) {
  2186.     dfl = (int)XbWFDb_GetNum(TOB->chn,"v",1);
  2187.     off = (int)XbWFDb_GetNum(TOB->chn,"m",1);
  2188.     if ((cfp = XbWSSy_fopen("xbe.xxx","wt")) != NULL) {
  2189.       if ((fp = XbWSSy_fopen(fname,"r+t")) != NULL) {
  2190.         ii=0;
  2191.         while (ii<off+dfl) {
  2192.           if (fgets(sstr,198,fp) == NULL){
  2193.             ii = 30000;
  2194.             off = 0;
  2195.             };
  2196.           ii++;
  2197.           };
  2198.         XbWVOb_pos=ftell(fp);
  2199.         fgets(sstr,198,fp);
  2200.         if (strchr(sstr,13) != NULL) {
  2201.           *((char*)strchr(sstr,13)) = 0;
  2202.           };
  2203.         if (strchr(sstr,10) != NULL) {
  2204.           *((char*)strchr(sstr,10)) = 0;
  2205.           };
  2206.         sstr[198] = 0;
  2207.         strcpy(cstr,sstr);
  2208.         str_len = strlen(sstr);
  2209.         {
  2210.           int kk;
  2211.           kk = strlen(sstr)-1;
  2212.           while ((kk >= 0) & (sstr[kk] == ' ')) {
  2213.             sstr[kk] = 0;
  2214.             kk--;
  2215.             };
  2216.           };
  2217.         XbWFEd_GetOStr(&XbWVWd_W,sstr,198,
  2218.           0,0,XbWVOb_x-XbWVOb_X,XbWVOb_y-XbWVOb_Y,sstr,
  2219.               ((XbWVMs_XPos - *XbWVWd_W.nx - *TOB->XA) / XbWFGr_TWidth("M"))
  2220.            );
  2221.         sstr[198] = 0;
  2222.         {
  2223.           int kk;
  2224.           kk = strlen(sstr)-1;
  2225.           while ((kk >= 0) & (sstr[kk] == ' ')) {
  2226.             sstr[kk] = 0;
  2227.             kk--;
  2228.             };
  2229.           };
  2230.         if (str_len >= strlen(sstr)) {
  2231.           fseek(fp,XbWVOb_pos,SEEK_SET);
  2232.           strncpy(cstr,sstr,strlen(sstr));
  2233.           {
  2234.             int kk;
  2235.             for (kk=strlen(sstr);kk<str_len;kk++){
  2236.               cstr[kk] = ' ';
  2237.               };
  2238.             };
  2239.           fwrite(cstr,str_len,1,fp);
  2240.           fclose(fp);
  2241.           fclose(cfp);
  2242.           }
  2243.         else{
  2244.           fseek(fp,0,SEEK_SET);
  2245.           ii = 0;
  2246.           while (!feof(fp)) {
  2247.             if (ii == (dfl+off)) {
  2248.               fgets(cstr,198,fp);
  2249.               fputs(sstr,cfp);
  2250.               fputs("\n",cfp);
  2251.               }
  2252.             else {
  2253.               if (fgets(cstr,198,fp) != NULL) {
  2254.                 fputs(cstr,cfp);
  2255.                 };
  2256.               };
  2257.             ii++;
  2258.             };
  2259.           fclose(fp);
  2260.           fclose(cfp);
  2261.           unlink(fname);
  2262.           rename("xbe.xxx",fname);
  2263.           };
  2264.         };
  2265.       fclose(cfp);
  2266.       };
  2267.     };
  2268.   return(1);
  2269.   };
  2270. /*}}}  */
  2271. /*{{{  XbWFOj_Ed_A(        ***,PRJ  Inhalt jeden Typs editieren*/
  2272. int  XbWFOj_Ed_A(int edit, XbWDDb_DbIObj  *TOB, int this_obj){
  2273. /* AUTOMATIC;
  2274.      "aln" Name der Liste zum Editieren
  2275.      "agn" Name der Var-Gruppe zum editieren
  2276.      "an" ist startnummer der var. zum editieren
  2277.      "ao" ist listen-offset zu anr; */
  2278.   int anr,aof,atp,ale;
  2279.   char aov[16], *ain;
  2280.   char *agr, *aon;
  2281.   char sstr[100];
  2282.   XbWDDb_DbIVar  *gr_st;
  2283.   XbWDDb_DbIVar  *ao_st;
  2284.  
  2285.   anr = (int)  XbWFDb_GetNum(TOB->chn,"an",1);
  2286.   aof = (int)  XbWFDb_GetNum(TOB->chn,"ao",1);
  2287.  
  2288.   if (!this_obj){
  2289.     gr_st = XbWFDb_FindGrp("OBX","act");
  2290.     if (gr_st == NULL) { return(0); };
  2291.     agr = (char*)XbWFDb_VarInh(gr_st,XbWDDb_Str,"aln",1);
  2292.     aon = (char*)XbWFDb_VarInh(gr_st,XbWDDb_Str,"agn",1);
  2293.  
  2294.     if ((ao_st = XbWFDb_FindGrp(agr,aon)) == NULL) { return(0); };
  2295.  
  2296.     }
  2297.   else { ao_st = TOB->chn; agr = "OBJ"; aon = (char*)TOB->onm; };
  2298.  
  2299.   anr = (int)  XbWFDb_GetNum(TOB->chn,"an",1);
  2300.   aof = (int)  XbWFDb_GetNum(TOB->chn,"ao",1);
  2301.  
  2302.   strcpy(sstr,"");
  2303.   if (XbWFDb_GetInf(ao_st,anr+aof,aov,&atp,&ain,&ale,0)) {
  2304.     sprintf(sstr,"%s:%s.%s",agr,aon,aov);
  2305.     {
  2306.       XbWDDb_DbIStr  *TSRC;
  2307.       XbWDDb_DbINPtr  *TTRG;
  2308.       if ((TTRG = (XbWDDb_DbINPtr  *)XbWFDb_VarInh(TOB->chn,0,"V",0)) != NULL){
  2309.         if ((TSRC = (XbWDDb_DbIStr  *)XbWFDb_GetDbI(
  2310.             agr,aon,aov)) != NULL){
  2311.           TTRG->inh = XbWDDb_C_PtrToDbI(TSRC,XbWDDb_DbISys);
  2312.           switch (atp) {
  2313.             case XbWDDb_Int:
  2314.             case XbWDDb_Dbl:
  2315.               XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2316.               if (edit==3){ return(0);};
  2317.               XbWFOj_EdInt(TOB);
  2318.               break;
  2319.             case XbWDDb_Str:
  2320.               XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2321.                 if (edit==3){ return(0);};
  2322.               {
  2323.                 char merker[200];
  2324.                 int SL,kk;
  2325.                 SL = ale;
  2326.                 if (ain != NULL) {
  2327.                   if (SL < 1) { SL = strlen(ain)+1; kk = SL-2; }
  2328.                   else {        kk = strlen(ain)-1;            };
  2329.                   if (strchr(ain,13) != NULL){ *((char*)strchr(ain,13)) = 0;};
  2330.                   if (strchr(ain,10) != NULL){ *((char*)strchr(ain,10)) = 0;};
  2331.                   while ((kk >= 0) & (ain[kk] == ' ')) {ain[kk]=0; kk--;    };
  2332.                   strcpy(merker,ain);
  2333.                   XbWFEd_GetOStr(&XbWVWd_W,merker,190,
  2334.                     0,0,XbWVOb_x-XbWVOb_X,XbWVOb_y-XbWVOb_Y,
  2335.                     merker,
  2336.                     ((XbWVMs_XPos - *XbWVWd_W.nx - *TOB->XA) / XbWFGr_TWidth("M"))
  2337.                     );
  2338.                   strncpy(ain,merker,SL-1);
  2339.                   ain[SL-1] = 0;
  2340.                   };
  2341.                 };
  2342.               break;
  2343.             case XbWDDb_NPtr:
  2344.             case XbWDDb_FPtr:
  2345.             case XbWDDb_IPtr:
  2346.             case XbWDDb_GPtr:
  2347.               XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2348.                 if (edit==3){ return(0);};
  2349.               {
  2350.                 XbWDDb_DbIPtr *ti;
  2351.                 char merker[100];
  2352.                 ti = (XbWDDb_DbIPtr*)ain;
  2353.                 strcpy(merker,(char*)XbWFDb_DbIToStr(*ti,XbWDDb_DbISys));
  2354.                 XbWFEd_GetOStr(&XbWVWd_W,merker,98,
  2355.                   0,0,XbWVOb_x-XbWVOb_X,XbWVOb_y-XbWVOb_Y,
  2356.                   merker,
  2357.                       ((XbWVMs_XPos - *XbWVWd_W.nx - *TOB->XA) / XbWFGr_TWidth("M"))
  2358.                   );
  2359.                 strcpy(merker,(char*)XbWFTb_PckTxt(merker));
  2360.                 *ti = (XbWDDb_DbIPtr)XbWFDb_StrToDbI(merker,XbWDDb_DbISys);
  2361.                 {
  2362.                   char s_l[40],
  2363.                        s_g[40],
  2364.                        s_n[40];
  2365.  
  2366.                   int ii;
  2367.  
  2368.                   /*  Format : <LISTE>:<GRUPPE>.<Element> */
  2369.  
  2370.                   if (strchr(merker,':') == NULL) {goto kein_pointer;};
  2371.                   if (strchr(merker,'.') == NULL) {goto kein_pointer;};
  2372.  
  2373.                   strncpy(s_l,&merker[0],29);
  2374.                   s_l[29]=0; *((char*)(strchr(s_l,':')))=0;
  2375.                   strncpy(s_g,strchr(merker,':')+1,29);
  2376.                   s_g[29]= 0;
  2377.                   *((char*)(strchr(s_g,'.')))=0;
  2378.                   strncpy(s_n,strchr(merker,'.')+1,29); s_n[29]= 0;
  2379.  
  2380.                   for (ii=0;ii<29;ii++){
  2381.                     switch(s_n[ii]) {
  2382.                       case '0': s_n[ii]=0;ii=1000;break;
  2383.                       };
  2384.                     };
  2385.                   if ((TTRG = (XbWDDb_DbINPtr  *)XbWFDb_GetDbI(
  2386.                      agr,aon,aov )) != NULL){
  2387.                     if ((TSRC = (XbWDDb_DbIStr  *)XbWFDb_GetDbI(
  2388.                         s_l,s_g,s_n)) != NULL){
  2389.                       TTRG->inh = XbWDDb_C_PtrToDbI(TSRC,XbWDDb_DbISys);
  2390.                       };
  2391.                     };
  2392.                   kein_pointer:;
  2393.                   };
  2394.                 };
  2395.               break;
  2396.             };
  2397.           };
  2398.         };
  2399.       };
  2400.     };
  2401.   return(1);
  2402.   };
  2403. /*}}}  */
  2404. /*{{{  XbWFOj_Ed_F(        ***      Fur Knopfe, die keine Ed-Variante haben*/
  2405. int  XbWFOj_Ed_F(int edit, XbWDDb_DbIObj  *TOB){
  2406.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWFTb_ColCon(*TOB->bkc),0,*TOB->bfc);
  2407.   if (edit != 3){ return(0); };
  2408.   XbWFTb_Wait(150);
  2409.   return(1);
  2410.   };
  2411. /*}}}  */
  2412. /*{{{  XbWFOj_Ed_S(        ***      String-Objekt editieren*/
  2413. int  XbWFOj_Ed_S(int edit, XbWDDb_DbIObj  *TOB){
  2414.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2415.   if (edit==3){ return(0);};
  2416.   XbWFOj_EdStr(TOB);
  2417.   return(1);
  2418.   };
  2419. /*}}}  */
  2420. /*{{{  XbWFOj_Ed_HID(      ***      HEX/Integer/Double editieren*/
  2421. int  XbWFOj_Ed_HID(int edit, XbWDDb_DbIObj  *TOB){
  2422.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2423.   if (edit==3){return(0);};
  2424.   XbWFOj_EdInt(TOB);
  2425.   return(1);
  2426.   };
  2427. /*}}}  */
  2428. /*{{{  XbWFOj_Ed_B(        ***      Boolesche Lampe editieren (invertieren)*/
  2429. int  XbWFOj_Ed_B(int edit, XbWDDb_DbIObj  *TOB){
  2430.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2431.   if (edit==3){ return(0);};
  2432.   XbWFOj_DpBool(TOB);
  2433.   return(1);
  2434.   };
  2435. /*}}}  */
  2436. /*{{{  XbWFOj_Ed_L(        ***      Light-Objekt editieren (auswerten)*/
  2437. int  XbWFOj_Ed_L(int edit, XbWDDb_DbIObj  *TOB){
  2438.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2439.   if (edit==3){ return(0);};
  2440.   XbWFOj_DpSwt(TOB);
  2441.   return(1);
  2442.   };
  2443. /*}}}  */
  2444. /*{{{  XbWFOj_Ed_C(        ***      Switch-Objekt auswerten*/
  2445. int  XbWFOj_Ed_C(int edit, XbWDDb_DbIObj  *TOB){
  2446.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2447.   if (edit==3){ return(0);};
  2448.   XbWFOj_EdSwt(TOB);
  2449.   return(1);
  2450.   };
  2451. /*}}}  */
  2452. /*{{{  XbWFOj_Ed_M(        ***      MFX-Gruppe lesen/schreiben*/
  2453. int  XbWFOj_Ed_M(int edit, XbWDDb_DbIObj  *TOB){
  2454.   XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,*TOB->bkc,0,XbWVGr_LRed);
  2455.   if (edit==3){ return(0);};
  2456.   XbWFOj_DpSwt(TOB);
  2457.  
  2458.   {
  2459.     char *rgr_nm, *rgr_rwm;
  2460.     char nsstr[40];
  2461.     int rw_smode,rw_snr;
  2462.     int ii;
  2463.  
  2464.     for (ii=0;ii<100;ii++){
  2465.       sprintf(nsstr,"xG%d",ii);
  2466.       if ((rgr_nm = (char*)XbWFDb_VarInh(TOB->chn,XbWDDb_Str,nsstr,1))
  2467.         == NULL) {  return(0); };
  2468.       sprintf(nsstr,"xM%d",ii);
  2469.       if ((rgr_rwm =(char*)XbWFDb_VarInh(TOB->chn,XbWDDb_Str,nsstr,1))
  2470.         == NULL) {  return(0); };
  2471.       sprintf(nsstr,"xS%d",ii);
  2472.       rw_smode = (int)XbWFDb_GetNum(TOB->chn,nsstr,1);
  2473.       sprintf(nsstr,"xN%d",ii);
  2474.       rw_snr = (int)XbWFDb_GetNum(TOB->chn,nsstr,1);
  2475.  
  2476.       XbWFMx_RWGrp(rgr_nm,rgr_rwm,rw_smode,rw_snr,NULL);
  2477.       };
  2478.     };
  2479.   return(1);
  2480.   };
  2481.  
  2482. /*}}}  */
  2483. /*{{{  XbWFOj_Ed_X(        ***      XS=Slider, XB=Bit editieren*/
  2484. int  XbWFOj_Ed_X(int edit, XbWDDb_DbIObj  *TOB){
  2485.   switch(TOB->oet[1]){
  2486.     case 'S':
  2487.               XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2488.               if (edit==3){ return(0);};
  2489.               XbWFOj_EdSlider(TOB);
  2490.               break;
  2491.     case 'B':
  2492.               XbWSGr_TLBox(XbWVOb_X,XbWVOb_Y,XbWVOb_x,XbWVOb_y,NULL,XbWVGr_White,0,XbWVGr_LRed);
  2493.               if (edit==3){ return(0);};
  2494.               XbWFOj_DpBit(TOB);
  2495.               break;
  2496.     };
  2497.   return(1);
  2498.   };
  2499. /*}}}  */
  2500. /*{{{  XbWFOj_Ed_T(        ***      Taskstart ausfuhren*/
  2501. int  XbWFOj_Ed_T(XbWDDb_DbIWdw  *WI, int edit, XbWDDb_DbIObj  *TOB){
  2502.   if (edit==3){ return(0);};
  2503.   XbWFOj_SpawnTsk(WI,TOB,'_','_','C','P');
  2504.   return(1);
  2505.   };
  2506. /*}}}  */
  2507.  
  2508. /*{{{  XbWFGr_MaxX(        ***      VIDEO: Breite des nutzbaren Schirms*/
  2509. int  XbWFGr_MaxX(void){
  2510.   return(XbWVIDEO_XB-XbWVIDEO_XA);
  2511.   };
  2512. /*}}}  */
  2513. /*{{{  XbWFGr_MaxY(        ***      VIDEO: Hoehe...*/
  2514. int  XbWFGr_MaxY(void){
  2515.   return(XbWVIDEO_YB-XbWVIDEO_YA);
  2516.   };
  2517. /*}}}  */
  2518. /*{{{  XbWFGr_TWidth(      ***      Pixelbreite eines Strings ermitteln*/
  2519. int  XbWFGr_TWidth(char *sstr){
  2520.   XbWDDb_DbIVar  *sv_gp;
  2521.   int cx=11;
  2522.   if (XbWVWd_Wdt == 0) {
  2523.     sv_gp = XbWFDb_FindGrp("SVR","video");
  2524.     if (sv_gp != NULL){
  2525.       cx = (int)XbWFDb_GetNum(sv_gp,"CharX",1);
  2526.       if (cx == 0){
  2527.         cx = 8;
  2528.         }
  2529.       else {
  2530.         XbWVWd_Wdt = cx;
  2531.         };
  2532.       };
  2533.     }
  2534.   else {
  2535.     cx = XbWVWd_Wdt;
  2536.     };
  2537.   return(cx*strlen(sstr));
  2538.   };
  2539. /*}}}  */
  2540. /*{{{  XbWFGr_THeight(     ***      Pixelhoehe eines Zeichens ermitteln*/
  2541. int  XbWFGr_THeight(void){
  2542.   XbWDDb_DbIVar  *sv_gp;
  2543.   int cy=8;
  2544.   if (XbWVWd_Hgt == 0){
  2545.     if (XbWVDb_DbkStrt != NULL){
  2546.       sv_gp = XbWFDb_FindGrp("SVR","video");
  2547.       if (sv_gp != NULL){
  2548.         cy = (int)XbWFDb_GetNum(sv_gp,"CharY",1);
  2549.         if (cy == 0){
  2550.           cy = 12;
  2551.           }
  2552.         else {
  2553.           XbWVWd_Hgt = cy;
  2554.           };
  2555.         };
  2556.       }
  2557.     else {
  2558.       cy = 12;
  2559.       };
  2560.     }
  2561.   else {
  2562.     cy = XbWVWd_Hgt;
  2563.     };
  2564.   return(cy);
  2565.   };
  2566. /*}}}  */
  2567.  
  2568. /*{{{  XbWFGr_PushPort(    ***      Viewport-Verwaltung*/
  2569. void  XbWFGr_PushPort(void){
  2570.   if (XbWVTb_ViewPZ >= XbWDTb_MxVwPrt) { XbWVTb_ViewPZ = 1; };
  2571.   if (XbWVTb_ViewPZ < 1) { XbWVTb_ViewPZ = XbWDTb_MxVwPrt;  };
  2572.   XbWSGr_GetClip(&XbWVTb_ViewPLst[XbWVTb_ViewPZ]);
  2573.   XbWVTb_ViewPZ++;
  2574.   };
  2575. /*}}}  */
  2576. /*{{{  XbWFGr_PopPort(     ****/
  2577. void  XbWFGr_PopPort(void){
  2578.   if (XbWVTb_ViewPZ >= XbWDTb_MxVwPrt) { XbWVTb_ViewPZ = 1; };
  2579.   if (XbWVTb_ViewPZ < 1) { XbWVTb_ViewPZ = XbWDTb_MxVwPrt;  };
  2580.   XbWVTb_ViewPZ--;
  2581.   XbWVTb_VPX = XbWVTb_ViewPLst[XbWVTb_ViewPZ].left;
  2582.   XbWVTb_VPY = XbWVTb_ViewPLst[XbWVTb_ViewPZ].top;
  2583.   XbWVTb_VPx = XbWVTb_ViewPLst[XbWVTb_ViewPZ].right;
  2584.   XbWVTb_VPy = XbWVTb_ViewPLst[XbWVTb_ViewPZ].bottom;
  2585.   };
  2586. /*}}}  */
  2587. /*{{{  XbWFGr_SetPort(     ****/
  2588. void  XbWFGr_SetPort(void){
  2589.   XbWSGr_SetClip(0,0,XbWSGr_GtPhysX(),XbWSGr_GtPhysY());
  2590.   };
  2591. /*}}}  */
  2592. /*{{{  XbWFGr_MaxPort(     ****/
  2593. void  XbWFGr_MaxPort(void){
  2594.   XbWSGr_SetClip(XbWVIDEO_XA,XbWVIDEO_YA,XbWVIDEO_XB,XbWVIDEO_YB);
  2595.   };
  2596. /*}}}  */
  2597. /*{{{  XbWFGr_MinPort(     ****/
  2598. void  XbWFGr_MinPort(int xxa,int yya,int xxb,int yyb){
  2599.   int xa,ya,xb,yb;
  2600.   xa=xxa+XbWVIDEO_XA;ya=yya+XbWVIDEO_YA;xb=xxb+XbWVIDEO_XA;yb=yyb+XbWVIDEO_YA;
  2601.   if (xa < XbWVIDEO_XA)   xa = XbWVIDEO_XA;
  2602.   if (ya < XbWVIDEO_YA)   ya = XbWVIDEO_YA;
  2603.   if (xb > XbWVIDEO_XB)   xb = XbWVIDEO_XB;
  2604.   if (yb > XbWVIDEO_YB)   yb = XbWVIDEO_YB;
  2605.   XbWVTb_VPX = xa; XbWVTb_VPY = ya; XbWVTb_VPx = xb; XbWVTb_VPy = yb;
  2606.   XbWSGr_SetClip(xa,ya,xb,yb);
  2607.   };
  2608. /*}}}  */
  2609. /*{{{  XbWFGr_RedPort(     ****/
  2610. void   XbWFGr_RedPort(
  2611.     int xa,int ya,int xb,int yb){
  2612.   xa+=XbWVIDEO_XA;ya+=XbWVIDEO_YA;xb+=XbWVIDEO_XA;yb+=XbWVIDEO_YA;
  2613.   if (xa < XbWVTb_VPX)   xa = XbWVTb_VPX;
  2614.   if (xa >= XbWVTb_VPx)   xa = XbWVTb_VPx-1;
  2615.   if (ya < XbWVTb_VPY)   ya = XbWVTb_VPY;
  2616.   if (ya >= XbWVTb_VPy)   ya = XbWVTb_VPy-1;
  2617.   if (xb <= XbWVTb_VPX)   xb = XbWVTb_VPX+1;
  2618.   if (xb > XbWVTb_VPx)   xb = XbWVTb_VPx;
  2619.   if (yb <= XbWVTb_VPY)   yb = XbWVTb_VPY+1;
  2620.   if (yb > XbWVTb_VPy)   yb = XbWVTb_VPy;
  2621.   if (xa < 5)   xa = 5;if (ya < 0)   ya = 0;
  2622.   if (xb > XbWFGr_MaxX())   xb = XbWFGr_MaxX();
  2623.   if (yb > XbWFGr_MaxY())   yb = XbWFGr_MaxY();
  2624.   if ((xb-xa > XbWFGr_MaxX()) |
  2625.      (yb-ya > XbWFGr_MaxY()))   {
  2626.     xa = 0; xb = 2; ya = 0; yb = 2;
  2627.     };
  2628.   if ((xb-xa < 3) |
  2629.      (yb-ya < 3))   {
  2630.     xa = 0; xb = 2; ya = 0; yb = 2;
  2631.     };
  2632.   XbWVTb_VPX = xa; XbWVTb_VPY = ya; XbWVTb_VPx = xb; XbWVTb_VPy = yb;
  2633.   XbWSGr_SetClip(xa,ya,xb,yb);
  2634.   };
  2635. /*}}}  */
  2636. /*{{{  XbWFGr_ResPort(     ****/
  2637. void   XbWFGr_ResPort(void){
  2638.   XbWSGr_SetClip(XbWVTb_VPX,XbWVTb_VPY,XbWVTb_VPx,XbWVTb_VPy);
  2639.   };
  2640. /*}}}  */
  2641.  
  2642. /*{{{  XbWFWd_BackGr(      ***      Hintergrund des Schirms fuellen*/
  2643. void   XbWFWd_BackGr(void){
  2644.   XbWFGr_SetPort();
  2645.   XbWSGr_TLBox(0,0,XbWSGr_GtPhysX()-1,XbWSGr_GtPhysY()-1,
  2646.     " ",XbWDGr_BkColor,0,XbWDGr_BkColor);
  2647.   XbWFGr_ResPort();
  2648.   };
  2649. /*}}}  */
  2650. /*{{{  XbWFWd_Erase(       ***      Window loeschen*/
  2651. void   XbWFWd_Erase(XbWDDb_DbIWdw  *WI){
  2652.   XbWFGr_MaxPort();
  2653.   XbWSGr_CCBox(
  2654.     *WI->nx-1,*WI->ny-1,
  2655.     *WI->nx+ *WI->sx+1, *WI->ny+ *WI->sy+1,
  2656.     NULL,XbWDGr_BkColor,0,XbWDGr_BkColor);
  2657.   };
  2658. /*}}}  */
  2659.  
  2660. /*{{{  XbWFTb_Message(     ***      Nachricht unten ausgeben*/
  2661. void  XbWFTb_Message(char *msg){
  2662.   int cset;
  2663.   cset = XbWVMs_CSet;
  2664.  
  2665.   XbWSMs_OFF();
  2666.   XbWFGr_PushPort();
  2667.   XbWFGr_SetPort();
  2668.   XbWSGr_TLBox(1,XbWSGr_GtPhysY()-XbWDWd_BordH,500,XbWSGr_GtPhysY()-1,
  2669.      msg,XbWVGr_Cyan,XbWVGr_White,XbWVGr_Green);
  2670.   XbWFGr_PopPort();
  2671.   XbWFGr_ResPort();
  2672.   if (cset) {
  2673.     XbWSMs_ON();
  2674.     };
  2675. #ifdef XbW_SYSDEF_X11_VERSION
  2676.   printf("\n%s",msg);
  2677. #endif
  2678.   };
  2679. /*}}}  */
  2680. /*{{{  XbWFTb_Warning(     ***      Nachricht unten ausgeben*/
  2681. void  XbWFTb_Warning(char *msg){
  2682.   int cset;
  2683.   cset = XbWVMs_CSet;
  2684.   XbWSMs_OFF();
  2685.   XbWFGr_PushPort();
  2686.   XbWFGr_SetPort();
  2687.   XbWSGr_TLBox(1,XbWSGr_GtPhysY()-XbWDWd_BordH,500,XbWSGr_GtPhysY()-1,
  2688.      msg,XbWVGr_Yellow,XbWVGr_DGray,XbWVGr_DGray);
  2689.   XbWFGr_PopPort();
  2690.   XbWFGr_ResPort();
  2691.   if (cset) {
  2692.     XbWSMs_ON();
  2693.     };
  2694.   };
  2695. /*}}}  */
  2696. /*{{{  XbWFTb_Error(       ***      Nachricht; warte auf Taste*/
  2697. void  XbWFTb_Error(char*msg){
  2698.   XbWSMs_OFF();
  2699.   printf("\n* * * A fatal error has occurred:\n%s\n",msg);
  2700.   printf("* * * Last command prepared: %s\nXbW command line buffer: %s\n\n",
  2701.     XbWVSy_DebugCommand,XbWVSy_DebugLine);
  2702.   if (XbWVMf_C >= 0){
  2703.     printf("Last command parameter prepared: no %d\n",XbWVMf_C);
  2704.     switch(XbWVMf_T[XbWVMf_C-1]) {
  2705.       case XbWDMf_StrPar:
  2706.         printf("* * * STRING PARAMETER \"%s\"\n",&(XbWVMf_B[(XbWVMf_C)*XbWDMf_BfStrL]));
  2707.         break;
  2708.       case XbWDMf_DblPar:
  2709.         printf("* * * DOUBLE PARAMETER \"%s\"\n",&(XbWVMf_B[(XbWVMf_C)*XbWDMf_BfStrL]));
  2710.         break;
  2711.       case XbWDMf_IntPar:
  2712.       case XbWDMf_VPPar:
  2713.         printf("* * * INT PARAMETER \"%d\"\n",(int)XbWVMf_P[XbWVMf_C]);
  2714.         break;
  2715.       case XbWDMf_VLPar:
  2716.         printf("* * * POINTER PARAMETER\n");
  2717.         break;
  2718.       case XbWDMf_VIPar:
  2719.         printf("* * * VI-INT PARAMETER \"%d\"\n",(int)XbWVMf_P[XbWVMf_C]);
  2720.         break;
  2721.       };
  2722.     };
  2723.  
  2724.   printf("\n* * * Actual interpreter scan position: >>>\"%s\"\n\n",XbWVSy_DebugLinePos);
  2725.  
  2726.   XbWSPu_Alarm(msg);
  2727.   XbWSMs_ON();
  2728.   XbWFMf_ReadMakro("@sys\\stop;");
  2729.   };
  2730. /*}}}  */
  2731. /*{{{  XbWFTb_CmpBox(      ***      Check ob Obj ganz außerhalb e.Wdws ist*/
  2732. int  XbWFTb_CmpBox(int oxa,int oya,int oxb,int oyb,
  2733.                 int wxa,int wya,int wxb,int wyb){
  2734. /*
  2735. Pr"uft ob Objekt oxa,oya..oxb,oyb im Window wxa,wya...wxb,wyb ist
  2736. */
  2737.   int inwin;
  2738.   inwin = 1;
  2739.   if (oxa > wxb) {inwin = 0;};
  2740.   if (oxb < wxa) {inwin = 0;};
  2741.   if (oya > wyb) {inwin = 0;};
  2742.   if (oyb < wya) {inwin = 0;};
  2743.   return(inwin);
  2744.   };
  2745. /*}}}  */
  2746.  
  2747. /*{{{  XbWFWd_Make(        ***      Window zeichnen (Jetzt nur noch Box...)*/
  2748. void   XbWFWd_Make(XbWDDb_DbIWdw  *WI){
  2749.   XbWFGr_MaxPort();
  2750.   XbWSGr_TLBox(
  2751.     *WI->nx-1, *WI->ny-1,
  2752.     *WI->nx+ *WI->sx+1, *WI->ny+ *WI->sy+1,
  2753.     NULL,
  2754.     *WI->bkc, 0, *WI->dfc);
  2755.   XbWSGr_Line(
  2756.     *WI->nx,          *WI->ny,
  2757.     *WI->nx+ *WI->sx, *WI->ny, *WI->bfc);
  2758.   XbWSGr_Line(
  2759.     *WI->nx,          *WI->ny,
  2760.     *WI->nx,          *WI->ny+ *WI->sy, *WI->bfc);
  2761.   XbWSGr_Line(
  2762.     *WI->nx,          *WI->ny-1,
  2763.     *WI->nx+ *WI->sx, *WI->ny-1, *WI->bfc);
  2764.   XbWSGr_Line(
  2765.     *WI->nx-1,        *WI->ny,
  2766.     *WI->nx-1,        *WI->ny+ *WI->sy, *WI->bfc);
  2767.   XbWSGr_Line(
  2768.     *WI->nx+ *WI->sx, *WI->ny,
  2769.     *WI->nx+ *WI->sx, *WI->ny+ *WI->sy, *WI->dfc);
  2770.   XbWSGr_Line(
  2771.     *WI->nx,          *WI->ny+ *WI->sy,
  2772.     *WI->nx+ *WI->sx, *WI->ny+ *WI->sy, *WI->dfc);
  2773.  
  2774.  
  2775.   XbWFGr_MinPort(*WI->nx+1, *WI->ny+1,*WI->nx+ *WI->sx-1,
  2776.                       *WI->ny+ *WI->sy-1);
  2777.   };
  2778. /*}}}  */
  2779.  
  2780. /*{{{  XbWFOb_SetViewPort( ***      Viewport auf Objekt einstellen*/
  2781. void  XbWFOb_SetViewPort(XbWDDb_DbIWdw  *WI,XbWDDb_DbIObj  *TO){
  2782.   int xa,ya,xb,yb;
  2783.   xa = *TO->XA;       ya = *TO->YA;       xb = *TO->XB;       yb = *TO->YB;
  2784.   if (xa < 0) { xa=0; };
  2785.   if (ya < 0) { ya=0; };
  2786.   if (xb < 0) { xb=0; };
  2787.   if (yb < 0) { yb=0; };
  2788.   if (xa > *WI->sx){ xa = *WI->sx; };
  2789.   if (ya > *WI->sy){ ya = *WI->sy; };
  2790.   if (xb > *WI->sx){ xb = *WI->sx; };
  2791.   if (yb > *WI->sy){ yb = *WI->sy; };
  2792.   XbWFGr_MinPort(
  2793.     *WI->nx+xa,
  2794.     *WI->ny+ya+1,
  2795.     *WI->nx+xb,
  2796.     *WI->ny+yb+1);
  2797.   };
  2798. /*}}}  */
  2799.  
  2800.